---
# System prepended metadata

title: "\U0001F3C5 Day 11 - 陣列操作"
tags: [JS 直播班 - 2023 秋季班]

---

---
tags: JS 直播班 - 2023 秋季班
---
# 🏅 Day 11 - 陣列操作

### 題目
請運用課堂中教到的陣列相關知識，依照下方註解敘述，完成下方程式碼（補上 `...` 的部分）


問題
---
```javascript=
let recipe = ['sugar', 'salt', 'flour', 'fruit'];

// 1. 請使用陣列方法取得 recipe 的長度，並使用 console.log 印出
console.log(...);

// 2. 請使用陣列取值方法取得結果為 'sugar' 的值，並使用 console.log 印出
console.log(...);

// 3. 請使用陣列取值方法取得結果為 'fruit' 的值，並使用 console.log 印出
console.log(...);

// 4. 請使用陣列方法替陣列 recipe 在最後新增一個值 'butter'
recipe...;
            
// 5. 請使用陣列方法刪除陣列 recipe 第 3 筆以後的資料（刪除 flour、fruit），最後印出整個陣列
recipe...;
console.log(recipe);
```

## 回報流程

將答案寫在 CodePen 並複製 CodePen 連結貼至底下回報就算完成了喔! 
解答位置請參考下圖（需打開程式碼的部分觀看）

![](https://i.imgur.com/vftL5i0.png)

<!-- 解答： 

// 1. 
console.log(recipe.length);
// 2. 
console.log(recipe[0]);
// 3. 
console.log(recipe[3]);
// 4. 
recipe.push('butter');
// 5.
recipe.splice(2, recipe.length-1);
console.log(recipe);

補充文章 - 「JS 常見陣列方法」：
https://www.casper.tw/development/2020/10/04/js-array-methods/
-->




回報區
---


|        Discord        |                                  CodePen / 答案                                  |
|:---------------------:|:--------------------------------------------------------------------------------:|
|詹姆士|[CodePen](https://codepen.io/z111048/pen/ExrxdQm)|
|pinyi_9|[CodePen](https://codepen.io/Wpypy/pen/VwgwEGB?editors=1011)|
|Andy|[CodePen](https://codepen.io/andy31342/pen/WNPNaLb?editors=0012)|
| tanuki5863 | [CodePen](https://codepen.io/tanuki320/pen/MWLWPNJ?editors=1011) |
|銀光菇|[CodePen](https://codepen.io/genesynthesis/pen/QWYWZXy)|
|Peng|[CodePen](https://codepen.io/H-Peng/pen/gOqOQYN?editors=0010)|
| Rxzan | [CodePen](https://codepen.io/Tzuru-Chen/pen/xxMxyBp) |
| Morning | [CodePen](https://codepen.io/sxzjnkxs-the-styleful/pen/wvNvQgM?editors=0011) |
| 風羽 | [CodePen](https://codepen.io/Joy-Huang/pen/poGoQWr?editors=0011) |
| Yijing | [CodePen](https://codepen.io/Yi-Jing-71080635/pen/vYbYQWo?editors=0011) |
| damon0323 | [CodePen](https://codepen.io/swk9eny2/pen/VwgwVXJ?editors=0010) |
| 荷菓かのり | [CodePen](https://codepen.io/oogxwkvw-the-builder/pen/GRzRwYo?editors=0011) |
| yuan! | [CodePen](https://codepen.io/townyuan/pen/bGzGQZW) |
| kawa | [CodePen](https://codepen.io/z83xji6/pen/BaMaGEp) |
| xiaokui_71292 | [CodePen](https://codepen.io/pen?template=XWOWyvo)|
| runweiting | [CodePen](https://codepen.io/weiting14/pen/abXbQXX)|
| Chia Pin | [CodePen](https://codepen.io/joker-cat/pen/poGoqRO) |
| 保羅| [CodePen](https://codepen.io/paul-1997/pen/Jjxjwyo?editors=0011) |
| zona| [CodePen](https://codepen.io/w242920/pen/BaMavZm?editors=1111) |
| yuan2781 | [CodePen](https://codepen.io/ismebir/pen/vYbYvgX) |
| Uli | [CodePen](https://codepen.io/uli1313/pen/XWOWoXG?editors=0012) |
| dora | [CodePen](https://codepen.io/dorayu/pen/Exrxdzb) |
| hsu0921| [CodePen](https://codepen.io/HSUANIN0327/pen/GRzRPPO) |
| yaoling.liang |[CodePen](https://codepen.io/Yao-Ling-L-/pen/rNPNoPN)|
| shawey.1a2b | [Codepen](https://codepen.io/Shawey/pen/PoVoxLG) |
| ming0712 | [Codepen](https://codepen.io/StevenHuang/pen/ExrxrYK?editors=0010) |
|Moreene|[CodePen](https://codepen.io/Moreene/pen/qBgBgdr)|
| claire | [CodePen](https://codepen.io/yi-wen-chen/pen/jOdOXYv) |
| 楓仔 | [CodePen](https://codepen.io/maplestartend/pen/JjxjxXW?editors=1112) |
| xuan | [CodePen](https://codepen.io/xuan0915/pen/BaMaMjq?editors=0012) |
| shuuu | [CodePen](https://codepen.io/afjrvjzl-the-bashful/pen/YzBzBQa?editors=0011) |
| cest_jessie | [CodePen](https://codepen.io/itsjessiechen/pen/PoVYKdB) |
| Ching | [CodePen](https://codepen.io/tzuchingg/pen/xxMxMJX?editors=0011) |
| RX00 | [CodePen]([網址](https://codepen.io/llqzknqv-the-styleful/pen/ExrxMPQ?editors=1111)) |
| santu0868 | [CodePen](https://codepen.io/HatsumiSan/pen/Rwvwdyw?editors=1010) |
| Ivy | [CodePen](https://codepen.io/Irene-Ke/pen/LYqYaJv?editors=1010) |
| Ataraxia | [CodePen](https://codepen.io/ataraxia8888/pen/LYqYLKP) |
| 依依 | [CodePen](https://codepen.io/Rita-Yang/pen/rNPNbWR?editors=0012) |
| Lychee KK | [CodePen](https://codepen.io/kakakala/pen/WNPNmPO) |
| Vivian2857 | [CodePen](https://codepen.io/uojbohed-the-solid/pen/XWOWQEv?editors=1010) |
| jiayu | [CodePen](https://codepen.io/fjqxaznl-the-reactor/pen/NWoWVOK?editors=0011) |
| Daylily | [CodePen](https://codepen.io/daylily/pen/xxMxNzL) |
| 奔跑吧(GTR150) | [CodePen](https://codepen.io/Wer-Qwe/pen/PoVovQX?editors=1111) |
| Zhu | [CodePen](https://codepen.io/codepenplayer/pen/NWoWVzQ) |
| ShangChu | [CodePen]([網址](https://codepen.io/shangchu0412/pen/QWYWXyE?editors=0011)) |
| ann6212 | [CodePen]([網址](https://codepen.io/yqmegupa-the-styleful/pen/rNPNEXq?editors=1012)) |
| xin | [CodePen]([網址](https://codepen.io/Estherrrrrr999/pen/ExrxqNz)) |
|Jun_|[CodePen](https://codepen.io/Jun-L/pen/gOqOVex)|
| Mattie | [CodePen](https://codepen.io/mattielin/pen/GRzRVay) |
| Tina02 | [CodePen](https://codepen.io/chjitlox-the-bashful/pen/poGvzbM) | 
| MDFK | [CodePen](https://codepen.io/maywang/pen/ZEwYzJQ?editors=0011) |
| 精靈 | [CodePen](https://codepen.io/justafairy/pen/jOdENGN) |
| smalljie | [CodePen](https://codepen.io/smalljie/pen/jOdEOEq) |
| Winnie | [CodePen](https://codepen.io/codepen-io-winnie/pen/NWoWJoj?editors=0011) |
| yu.t_liu | [CodePen](https://codepen.io/YuT200053/pen/bGzNNNR?editors=0011) |
| Eden |[Codepen](https://codepen.io/iseden/pen/poGvvdx)|
| Alyce |[Codepen](https://codepen.io/alycehwy/pen/qBgEddR?editors=0010)|
| SHUO | [CodePen]( https://codepen.io/xrzarxkl-the-reactor/pen/JjxodLy ) |
| KUN. | [CodePen]( https://codepen.io/barry91205/pen/zYexGVd?editors=1111 ) |
| LinaChen | [CodePen](https://codepen.io/LinaChen/pen/NWoPPXY) |
| hsuanlee1084 | [CodePen](https://codepen.io/hsuanlee1024/pen/Jjxodgp) |
|OSN|[Codepen](https://codepen.io/osncodepen/pen/eYxmNZN?editors=1111)|
|CPing|[Codepen](https://codepen.io/CPing/pen/yLZyYLV)|
|Zem|[Codepen](https://codepen.io/Potoro/pen/BaMyoWN?editors=1010)|
| Fabio20 | [CodePen](https://codepen.io/fabio7621/pen/ExraVrO) |
| MY | [CodePen](https://codepen.io/ahmomoz/pen/ExraVqG?editors=1111) |
| Helen | [CodePen](https://codepen.io/milkteamonster/pen/zYexroX?editors=0010) |
| shiro | [CodePen](https://codepen.io/chenghsienwang/pen/zYexBvP)|
| celinelinnn |[CodePen](https://codepen.io/celinephoebe/pen/oNmgzpb)|
| 小夏 |[CodePen](https://codepen.io/michaelhsia/pen/oNmgwvy)|
|阿榮|[Codepen](https://codepen.io/codeitaday/pen/vYbEJXL)|
| 維哲 | [CodePen](https://codepen.io/kwz1202/pen/PoVwKXO) |
| Allen | [CodePen](https://codepen.io/hlctw/pen/MWLYEPK) |
| phyllis_0802 | [CodePen](https://codepen.io/Phyllis-Cheng/pen/zYexPvE) |
| hsiu8767 | [CodePen](https://codepen.io/hsiu8767/pen/poGvWxJ?editors=1011)|
| Lainie | [CodePen](https://codepen.io/Lainie88/pen/OJdPPeZ?editors=0012) |
| kuanju27 | [CodePen](https://codepen.io/Eero-Chiao/pen/poGvaqJ) |
| Leo | [CodePen](https://codepen.io/Aruminiya/pen/YzBPaxg) |
| Joy chiang | [CodePen](https://codepen.io/fwysphbw-the-vuer/pen/jOdEzmM?editors=1010) |
| sponge | [CodePen](https://codepen.io/biunpujm-the-flexboxer/pen/GRzgdQW?editors=1111) |
| sunny_08149 | [CodePen](https://codepen.io/Sunny-Lin/pen/gOqbKOo) |
| minnielin| [CodePen](https://codepen.io/ShengXin-Lin/pen/wvNBXMx?editors=1111) |
| 凱恩| [CodePen](https://codepen.io/Royen0506/pen/KKJwBMM?editors=1111) |
|Hank._.z|[CodePen](https://codepen.io/linoiaby-the-sans/pen/MWLYPxy)
|Rogan|[CodePen](https://codepen.io/RoganHsu/pen/vYbEaWM?editors=0011)
|jimmy.0706| [CodePen](https://codepen.io/WeiJun-Mao/pen/YzBPBGx?editors=0010) |
| yuling | [CodePen](https://codepen.io/igzdflpu/pen/abXzMOL) |
| gebyman | [CodePen](https://codepen.io/gebyman/pen/mdvyYyM?editors=0012) |
| noah | [CodePen](https://codepen.io/lch1222/pen/dyaombJ?editors=0011) |
| nini1202desu | [CodePen](https://codepen.io/tvxq5206/pen/WNPvzPx?editors=0011) |
| Oria| [CodePen](https://codepen.io/kajing/pen/YzBXOJw?editors=0012) |
| 阿賀#3700| [CodePen](https://codepen.io/sungho/details/bGzdREX) |
| 白夜 | [CodePen](https://codepen.io/Wei903/pen/KKJdPqb?editors=0012) |
| Jerry | [CodePen](https://codepen.io/ildkosxk-the-encoder/pen/wvNKvWZ)|
| 蛋塔 | [CodePen](https://codepen.io/Hong-Game1/pen/KKJdpdx)|
| JasonFu | [CodePen](https://codepen.io/jie-Fu/pen/qBgOOYo)|
| nikkita_3544|[CodePen](https://codepen.io/vanessa7259/pen/NWoGxYj?editors=1111)|
| ⭐️小正 | [CodePen](https://codepen.io/colorgolden/pen/RwvWRoB) |
| QOO#8446 | [CodePen](https://codepen.io/QOOQOOQ/pen/mdvdarO?editors=0012)|
| _shun0130 | [CodePen](https://codepen.io/koba60052ww/pen/JjxYKby?editors=0010)
| IRIS | [CodePen](https://codepen.io/sz594380/pen/qBgOjNX?editors=0010)
| RX00 | [CodePen](https://codepen.io/llqzknqv-the-styleful/pen/gOqaQBE?editors=0011)
| Befun | [CodePen](https://codepen.io/richard260572/pen/ExrVqJG?editors=0011)
| 歐陽龍龍#1061 | [CodePen](https://codepen.io/dizzydog-rgb/pen/wvNMBpG)
| 阿維#2569 | [CodePen](https://codepen.io/iijojpli-the-looper/pen/NWoxeLR?editors=0011) |
| peggy | [CodePen](https://codepen.io/peggylai/pen/MWLKdZZ?editors=1010) |
| Iris | [CodePen](https://codepen.io/iris831206/pen/abXdgmd) |
| 小廷 | [CodePen](https://codepen.io/uyxkiake-the-selector/pen/oNmxVrG?editors=0011) |
| davidtt | [CodePen](https://codepen.io/David-Tsai/pen/dyapXNY?editors=0011) |
| Cosmos| [CodePen](https://codepen.io/violet7755/pen/dyapjLp) |
| 郭芙蘭#6374| [CodePen](https://codepen.io/flora_Kuo/pen/qBgaJoJ?editors=1011) |
| hsuhsusophie| [CodePen](https://codepen.io/hsuhsusophie/pen/ZEwBMjE?editors=0012) |
| Rochel |[Codepen](https://codepen.io/rochelwang1205/pen/KKJaKje?editors=0010)|
| shcopy |[Codepen](https://codepen.io/shcopy/pen/gOqmwex)|
| _Luna |[Codepen](https://codepen.io/sfctsolp-the-sasster/pen/YzBZoNR?editors=0011)|
| ＣhrisSQR |[Codepen](https://codepen.io/ChrisSQR/pen/VwgrWxp)|
| macihuang |[Codepen](https://codepen.io/macy1215/pen/abXjNmb)|
|angela9741|[Codepen](https://codepen.io/coding-angela25/pen/XWOBdzW?editors=0010)
|bf_tsai|[Codepen](https://codepen.io/BF-Tsai/pen/YzBOzrL?editors=1111)
| NathanJames |[Codepen](https://codepen.io/ufo060204/pen/qBgMpyL)|
| skypassion5000 |[Codepen](https://codepen.io/skypassion5000/pen/MWLPQOB?editors=0011)|
| 辣椒 |[Codepen](https://codepen.io/chilichen118/pen/abXQJmW)|
