---
# System prepended metadata

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

---

---
tags: JS 直播班 - 2022 秋季班
---
# 🏅 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 / 答案                                  |
|:---------------------:|:--------------------------------------------------------------------------------:|
|    masterYan#2480     |    [CodePen](https://codepen.io/htzwgoqt-the-looper/pen/mdLgROW?editors=1011)    |
|        YC#2522        |                  [CodePen](https://codepen.io/YCLu/pen/dyeLMpL)                  |
|      JackC#0411       |                [CodePen](https://codepen.io/key0329/pen/gOzyrgp)                 |
|       Ayre#0016       |        [CodePen](https://codepen.io/yichunlin09/pen/jOxRqym?editors=0010)        |
|    hsiung阿熊#4079    |               [Codepen](https://codepen.io/hsiungchi/pen/JjvVXRe)                |
|       Data#9297       |               [Codepen](https://codepen.io/kirakira72/pen/XWqQdMY)               |
|      azami#5986       |                 [Codepen](https://codepen.io/azami/pen/XWqQdRY)                  |
|      albee#9121       |        [Codepen](https://codepen.io/albee-chang/pen/JjvVXJw?editors=1010)        |
|       yumy#1940       |               [Codepen](https://codepen.io/yumy_yamg/pen/zYjXqdJ)                |
|    shinyhung#3825     |         [Codepen](https://codepen.io/sean_1215/pen/RwyOaLN?editors=1011)         |
|      Clara#1275       |         [Codepen](https://codepen.io/bsupixqu/pen/MWGRyEQ?editors=0010)          |
|      Judy☻ #7874      |         [CodePen](https://codepen.io/hsiaohan/pen/yLjrOpp?editors=1011)          |
|      無名 #7874       |          [CodePen](https://codepen.io/Nomoney/pen/BaxbaMM?editors=0011)          |
|       威0#6919        |        [Codepen](https://codepen.io/n0918679182/pen/mdLgPjV?editors=0011)        |
|     yoshidc#0455      |                [CodePen](https://codepen.io/yoshiyyc/pen/ZEoZWoR)                |
|     WEI_RIO#9342      |          [Codepen](https://codepen.io/wei_wu/pen/PoegNdG?editors=0011)           |
|       m_m#5493        |               [Codepen](https://codepen.io/minnn7716/pen/WNJWwLZ)                |
|      Winnie#1306      |      [Codepen](https://codepen.io/WinnieWuWinnie/pen/KKRYzJo?editors=0011)       |
|       末次#0236       |                [CodePen](https://codepen.io/yunjulee/pen/mdLgPQP)                |
|       威爾#1694       |                [CodePen](https://codepen.io/WILL_Wu/pen/wvjZGNe)                 |
|       Peng#9811       |                [CodePen](https://codepen.io/peng-027/pen/RwyOava)                |
|        YI#0863        |          [CodePen](https://codepen.io/YI0305/pen/oNdOxRg?editors=0012)           |
|       母湯#7211       |        [CodePen](https://codepen.io/tommyshih77/pen/abGXedL?editors=0010)        |
|    jackson204#6363    |        [CodePen](https://codepen.io/jackson204/pen/yLjrJBx?editors=1111)         |
|      魚子醬#5220      |         [CodePen](https://codepen.io/haihsuan/pen/JjvVKjP?editors=1111)          |
|     AuroraC#6539      |          [codepen](https://codepen.io/AuroraC/pen/xxjeOGK?editors=0012)          |
|    KatyChiang#1554    |          [codepen](https://codepen.io/Kai0819/pen/poVBbJO?editors=0010)          |
|       芮綺#5224       |          [codepen](https://codepen.io/zhan70/pen/gOzyMbm?editors=0011)           |
|   William Lai#0196    |               [codepen](https://codepen.io/lai-weihan/pen/OJZGXPg)               |
|      Barret#1119      |        [CodePen](https://codepen.io/barret0720/pen/NWMmNZw?editors=0011)         |
|       RJRS#9430       |                  [CodePen](https://codepen.io/RJRS/pen/YzLMWwW)                  |
|   jacky010080#0880    |       [CodePen](https://codepen.io/Yen-Jung-Chen/pen/abGxZmo?editors=0011)       |
|       薯餅#3581       |             [codepen](https://codepen.io/ColdingPoTaTo/pen/WNJWxxJ)              |
|    JustinLiu#9699     |        [CodePen](https://codepen.io/justin0227/pen/eYrozBo?editors=0012)         |
|      楓之聲#6945      |               [Codepen](https://codepen.io/sshane258/pen/xxjeOqb)                |
|       kuku#3118       |        [Codepen](https://codepen.io/mengting-ku/pen/BaxEzZY?editors=1011)        |
|      法希娜#3206      |   [Codepen](https://codepen.io/yiiserpf-the-encoder/pen/BaxEzWJ?editors=1012)    |
|      yawun#0042       |               [CodePen](https://codepen.io/monicalin/pen/ExLJyXx)                |
|        VT#0895        |                 [Codepen](https://codepen.io/vt197/pen/gOzyMoX)                  |
|        Rr#2215        |              [Codepen](https://codepen.io/rufangcheng/pen/MWGRyzX)               |
|    LHchien33#6232     |         [Codepen](https://codepen.io/lin_chien/pen/PoegzEE?editors=0011)         |
|     CloThEs#7837      |                [Codepen](https://codepen.io/CloThEsZ/pen/qBYwNVZ)                |
|       圈圈#4060       |     [Codepen](https://codepen.io/wjejfczn-the-bold/pen/LYmvNQo?editors=1111)     |
|       Vera#5592       |                 [CodePen](https://codepen.io/skvera/pen/YzLMGPY)                 |
|      amy芳#1385       |               [CodePen](https://codepen.io/amy-chieng/pen/wvjZzBR)               |
|     Hironaka#7367     |       [CodePen](https://codepen.io/Hironaka0815/pen/eYrodBz?editors=0010)        |
|      IreneY#0086      |           [codepen](https://codepen.io/HalfPlannedJourney/pen/dyeLpVe)           |
|     PayRoom#8328      |               [CodePen](https://codepen.io/water38198/pen/poVBErj)               |
|      homer#1525       |                [CodePen](https://codepen.io/Buckhorn/pen/abGxmLy)                |
|      Mylène#2481      |              [Codepen](https://codepen.io/hamajibashi/pen/qBYwaYx)               |
|      Cliff#4606       |               [Codepen](https://codepen.io/Cliff_hex/pen/NWMmRMW)                |
|     hannahTW#2224     |         [Codepen](https://codepen.io/hangineer/pen/XWqQjYg?editors=0011)         |
|       Yiru#0236       |          [Codepen](https://codepen.io/yiru94/pen/dyeLpgq?editors=0011)           |
|      Greta#0837       |                [CodePen](https://codepen.io/gretali/pen/ZEoZpme)                 |
|      Arista#5802      |              [CodePen](https://codepen.io/arista-hsieh/pen/yLjraWg)              |
|     banazita#5143     |         [CodePen](https://codepen.io/banazita/pen/yLjramM?editors=1111)          |
|     Mia小福#4473      |                [CodePen](https://codepen.io/a0950271/pen/XWqQNbZ)                |
|    jimmyFang#9575     |         [CodePen](https://codepen.io/pohxiqqo/pen/wvjZoMM?editors=0010)          |
|       cbs#9007        |                 [Codepen](https://codepen.io/wasdjk/pen/VwxNmwg)                 |
|    0xWilliam #8796    |       [CodePen](https://codepen.io/0xWilliam0322/pen/bGMJBgw?editors=0011)       |
|       Ohno#1144       |         [Codepen](https://codepen.io/mmaa7850/pen/qBYwqRL?editors=0011)          |
|    suihsilan#9485     |         [Codepen](https://codepen.io/suihsilan/pen/jOxRVzG?editors=0010)         |
|      教練 #6451       |             [CodePen](https://codepen.io/monkeybear721/pen/ExLJNLO)              |
|       竹輪#3335       |              [CodePen](https://codepen.io/chikuwa0120/pen/bGMJBMq)               |
|       Rena#6249       |        [CodePen](https://codepen.io/aureate0116/pen/mdLgOQP?editors=1011)        |
|     Silvialu#4521     |              [CodePen](https://codepen.io/Silvia091640/pen/KKRYNYo)              |
|      Chung#5951       |          [CodePen](https://codepen.io/yuju16/pen/NWMmdxy?editors=0011)           |
|       雷雷#7844       |        [CodePen](https://codepen.io/lei-yi-jie/pen/jOxRyqK?editors=0010)         |
|    Potatolee#7749     |        [CodePen](https://codepen.io/potatoleee/pen/ExLJZvx?editors=0010)         |
|      Curtis#4780      |         [CodePen](https://codepen.io/curtislin/pen/JjvVEvX?editors=0010)         |
|       yen#5757        |             [CodePen](https://codepen.io/TZU-HUANG-YEN/pen/oNdPgqY)              |
|     泰泰泰泰#0582     |   [CodePen](https://codepen.io/tesdzzph-the-bashful/pen/poVBejz?editors=0011)    |
|       小白#2406       |               [CodePen](https://codepen.io/gracewhite/pen/MWGRpWY)               |
|     kenki100#0068     |                 [codepen](https://codepen.io/ken100/pen/oNdOZWp)                 |
|      Benson#6763      |                [Codepen](https://codepen.io/kumashow/pen/QWrPvNG)                |
|      SASIMI#5099      |              [Codepen](https://codepen.io/sashimi1327/pen/vYjzZeB)               |
|      Hilda#7085       |           [Codepen](https://codepen.io/vwquikad-the-vuer/pen/XWqQRZB)            |
|     jamesccc#6244     |   [Codepen](https://codepen.io/nimwnynv-the-sasster/pen/JjvVJGj?editors=1111)    |
|    出事了阿伯#9923    |        [Codepen](https://codepen.io/BradpittLai/pen/GRdLmXZ?editors=1011)        |
|      Velma#1693       |          [Codepen](https://codepen.io/Ze1225/pen/jOxRwzQ?editors=0010)           |
|     Amberhh#2465      |                [Codepen](https://codepen.io/Amberhh/pen/ZEoZWwM)                 |
|     RyanTsai#8906     |                [CodePen](https://codepen.io/linlaose/pen/vYjMJGR)                |
|       yoyo#1003       |       [CodePen](https://codepen.io/crpbugqy-the-typescripter/pen/jOxRLzP)        |
|       鑫鑫#4346       |         [CodePen](https://codepen.io/Neil1024/pen/jOxRLdq?editors=0011)          |
|      肉桂卷#0625      |          [CodePen](https://codepen.io/ginnlee/pen/abGxyjL?editors=0011)          |
|    Daisy Li #4231     |    [CodePen](https://codepen.io/lidairong-gmail-com/pen/gOzyGaY?editors=0012)    |
|      shio #1414       |          [CodePen](https://codepen.io/shioyen/pen/XWqQedZ?editors=1112)          |
|    Ruby Chen#7452     |         [CodePen](https://codepen.io/ruby92429/pen/rNvbzry?editors=1111)         |
|       健育#5748       |                [CodePen](https://codepen.io/c1317156/pen/abGxLwa)                |
|      哈囉哈#5196      |        [CodePen](https://codepen.io/bill0841205/pen/MWGREZG?editors=1111)        |
|       萱仔#0781       |        [CodePen](https://codepen.io/ting-hsuan/pen/RwyOLOr?editors=0110)         |
|     mandylai#4055     |              [CodePen](https://codepen.io/mandy-lai-2/pen/qBYwVNE)               |
|       大衛#4869       |         [CodePen](https://codepen.io/exnsrpjc/pen/ExLJbMP?editors=0011)          |
|       hua#9099        |           [Codepen](https://codepen.io/LHua/pen/yLjrvNM?editors=0111)            |
|     hayaka #4579      |                [CodePen](https://codepen.io/CocoCat/pen/gOzyeam)                 |
|      黃士桓#7654      |      [codePen](https://codepen.io/shr-huan-huang/pen/QWrPQmg?editors=0010)       |
|       阿風#6890       |         [codePen](https://codepen.io/Afonguwu/pen/xxjeWJZ?editors=0110)          |
|     beta lin#1445     |                [CodePen](https://codepen.io/linbeta/pen/eYroMMw)                 |
|       蓁心#6229       | [codePen](https://codepen.io/tlorfrnl-the-typescripter/pen/eYrorWZ?editors=1011) |
|       Fan#3405        |          [codePen](https://codepen.io/Fan123/pen/MWGRBaq?editors=1111)           |
|       mou#2215        |       [codePen](https://codepen.io/shihchiehlan/pen/bGMJMoy?editors=0010)        |
|       LQQ#4187        |               [codePen](https://codepen.io/morefoodq/pen/KKRYxVO)                |
|    勁辣雞腿寶#5817    |         [codePen](https://codepen.io/orz311013/pen/jOxRvQb?editors=0011)         |
|     MJ_Eddie#5258     |                [CodePen](https://codepen.io/nick-lin/pen/yLjrwWW)                |
|       予予#9627       |         [CodePen](https://codepen.io/kiqzcraa/pen/ZEoZZpG?editors=0011)          |
|      心幻羽#0056      |        [CodePen](https://codepen.io/linglingsyu/pen/gOzyyWd?editors=1111)        |
|      Ringo#7583       |       [CodePen](https://codepen.io/ringolai1988/pen/ExLJJXZ?editors=0010)        |
|       Gill#9280       |         [CodePen](https://codepen.io/Gill-Chin/pen/ZEoZZXQ?editors=0011)         |
| 軟綿綿 (๑•ᴗ•๑) ♡#3627 |       [CodePen](https://codepen.io/Connie-Chien/pen/OJZGYxy?editors=0011)        |
|      Shiimu#4307      |          [CodePen](https://codepen.io/len5464/pen/wvjZbPG?editors=0011)          |
|      Yishan#4902      |   [CodePen](https://codepen.io/gdjrehhw-the-animator/pen/mdLgZJE?editors=0011)   |
|     KC_8685#9343      |               [CodePen](https://codepen.io/cathy7411/pen/abGxreM)                |
popcorn_3q#9893|[CodePen](https://codepen.io/arnyrpqt-the-sasster/pen/poVBMzm?editors=0010)
|      Loran#1105      |   [CodePen](https://codepen.io/loranlin/pen/poVBMom?editors=1011)   |
|       Lou#0085        |       [codePen](https://codepen.io/Lusie_H/pen/WNJWVQP?editors=0011)        |
|yaru#6308|[Codepen](https://codepen.io/lszaietc/pen/mdLgZbP?editors=0011)|
|charlottelee849#0366|[Codepen](https://codepen.io/charlotte-lee/pen/qBYweam?editors=0011)|
|痴醉兔#3706|[Codepen](https://codepen.io/wei-nie/pen/XWqwroP?editors=0011)|
|Kevin#6131|[Codepen](https://codepen.io/xlqjezvc-the-encoder/pen/RwymwOZ?editors=0011)|
|hungya#0773|[Codepen](https://codepen.io/hungya777/pen/RwymwjK?editors=0011)|
|艾芮絲#6060|[Codepen](https://codepen.io/wangyingju/pen/poVmoYY)|
|Tami#6742|[CodePen](https://codepen.io/wqsdqbjn-the-vuer/pen/RwymwzL?editors=0011)|
|Hazel.#6020|[CodePen](https://codepen.io/Hazelhsieh/pen/XWqwJJb?editors=0011)|
|k.sin#3115|[CodePen](https://codepen.io/sin588/pen/GRdagBw?editors=0011)|
Judy Wei#6103|[CodePen](//codepen.io/Judy0718/pen/RwymPOP)|
|Eileen#6454|[CodePen](//codepen.io/Eileen-io/pen/YzLbymQ)|
|RosaC#4286|[CodePen](//https://codepen.io/RosarC/pen/VwxOaow?editors=1011)|
|ssozr#4680|[codepen](https://codepen.io/ssozr/pen/RwyOGWy?editors=0010)|
|jin.huang#4666|[codepen](https://codepen.io/haha1196/pen/XWqwjmb?editors=0010)|
|王懷英#7271|[codepen](https://codepen.io/huaiying/pen/eYradYO)|
|Ryan Chiang#6649|[Codepen](https://codepen.io/ryanchiang/pen/PoevbWY?editors=0012)|
|ling chang#1024|[Codepen](https://codepen.io/ling-chang/pen/mdLYWGG)|
|黑松胖#4836|[Codepen](https://codepen.io/yi-chien-hsieh/pen/OJZYmWJ?editors=0012)
|J_u_d_y#5993|[Codepen](https://codepen.io/J_u_d_y/pen/bGMyrpm)|
|CofCat#9226|[Codepen](https://codepen.io/cofcat456/pen/BaxedME?editors=1111)|
|bingsu#2362|[Codepen](https://codepen.io/pmyfr/pen/OJZYzyZ?editors=0010)|
|Wei#2330|[Codepen](https://codepen.io/ixfjxrbo-the-typescripter/pen/jOxozxK)|
|君Jyun#0147|[codepen](https://codepen.io/Okaybeok/pen/ZEoNxwZ?editors=0011)|
|FiReBrO#0557|[codepen](https://codepen.io/firebro42/pen/abGraJZ?editors=1011)|
|PoWei#8484|[codepen](https://codepen.io/harrison-wei-lai/pen/vYjwzrR?editors=1111) |
|AkiHico#9239|[codepen](https://codepen.io/akihico/pen/bGMyxQy?editors=1010)|
|我是泇吟#5189|[CodePen](https://codepen.io/kljuqbxs/pen/WNJBPeN)|
|朧.#9548|[codepen](https://codepen.io/crushing_omega/pen/XWqwOZV?editors=1010)|
|黑白兔#0684|[codepen](https://codepen.io/johnny329/pen/qBYGvpW)|
|Ron Liang#7277|[codepen](https://codepen.io/ron-go/pen/mdLYZyJ)|
|狸貓#5863|[codepen](https://codepen.io/tanuki320/pen/yLjWdaK?editors=1010)|
|Lucie#3831|[Codepen](https://codepen.io/bisespei/pen/PoevrVK)|
|Evelyne#7323|[Codepen](https://codepen.io/Evelynep/pen/vYjwodp)|
|郭芙蘭#6374|[Codepen](https://codepen.io/flora_Kuo/pen/MWGRXdX)|
|RuoAn#7124|[Codepen](https://codepen.io/LiauRuoAn/pen/GRdbRgp?editors=0010)|
|Rice#8043|[Codepen](https://codepen.io/riecball/pen/yLjdbLY?editors=0011)|
|SunnyCheng#4113|[Codepen](https://codepen.io/Sunny0509/pen/gOzNWbZ?editors=0011)|
|Cynthia1111#1822|[Codepen](https://codepen.io/Cynthia1111/pen/vYjqWGB?editors=0010)|
|Karol-Kuo#5287|[Codepen](https://codepen.io/ting-yu-kuo/pen/bGMPjwB?editors=1011)|
|阿富#0389|[Codepen](https://codepen.io/spring40747/pen/zYjVJVK?editors=1111)|
|艸良#2846|[Codepen](https://codepen.io/momoninainai/pen/GRdVgmv?editors=0010)|
|pss940909#8650|[Codepen](https://codepen.io/pss940909/pen/mdLNyqB?editors=0011)|
|Nini Chen#5790|[Codepen](https://codepen.io/ninistyle/pen/BaxXjWY?editors=0012)|
|CJ07#0176|[codepen](https://codepen.io/cjtseng07/pen/BaxXzpK?editors=0011)|
|L0F0#8733|[codepen](https://codepen.io/l0f0/pen/KKROMXX?editors=0011)|
|Cookie SSS#6991|[codepen](https://codepen.io/sqhjikpa-the-selector/pen/YzLmGdx?editors=0012)|
|Chloe#5422|[CodePen](https://codepen.io/Ironchloe/pen/gOzVgdM?editors=0010)|
|Shuo#1596|[CodePen](https://codepen.io/chiangchungshuo/pen/oNdKWay?editors=1011)|
|YU#0618|[CodePen](https://codepen.io/yoken_/pen/rNvXYBG)|
|Paul#7426|[CodePen](https://codepen.io/paul-1997/pen/oNdKJmB?editors=0011)|
|Jhen#4563|[CodePen](https://codepen.io/su-jhen/pen/rNvXXqX)|
|Kimi #9564|[Codepen](https://codepen.io/kimihu91/pen/rNKNPwB)|
|Yuna Huang#2692|[Codepen](https://codepen.io/Yuna1002/pen/RwJbPXE?editors=0011)|
|安o#2448|[Codepen](https://codepen.io/JzhenAn/pen/MWXgJep)|
|DoraHuang#8223|[Codepen](https://codepen.io/mwebwvuq-the-flexboxer/pen/JjZjZYd)|
|christina#6185|[Codepen](https://codepen.io/chrisc0210/pen/XWYWGaR)|
|三隻小貓#1905|[CodePen](https://codepen.io/bagelover/pen/YzvzbaQ)|
|Jamie Wu#9345|[CodePen](https://codepen.io/Wu220103/pen/abKzNZo)|
|阿蘇#8531|[CodePen](https://codepen.io/susu3131/pen/WNybxgv?editors=0011)|
|awei#0720|[CodePen](https://codepen.io/Aweishi/pen/ExRaEWZ)|
|Cream#3449|[CodePen](https://codepen.io/frxdwbbi-the-sasster/pen/KKewBpj?editors=0111)|
|sophiee#7015|[Codepen](https://codepen.io/sophiee2727/pen/gOKpqem?editors=1111)|
|H.L.C#2152|[Codepen](https://codepen.io/hsin-liang/pen/PoaPKKr)|
|Azi Hsieh#2861|[CodePen](https://codepen.io/AziHsieh/pen/KKedRoM)|
|yuling#1634|[codepen](https://codepen.io/igzdflpu/pen/zYaveyb)|
|How#5806|[codepen](https://codepen.io/howtobefine/pen/qBKbmLz)|
|mei#8421|[codepen](https://codepen.io/Shila-Chen/pen/xxzxeQo?editors=0011)|
|kancheng#3915|[CodePen](https://codepen.io/kancheng/pen/wvXGoEz?editors=0010)|
|lee#5462|[CodePen](https://codepen.io/barrylee85/pen/yLEaYMP?editors=0011)|
|Sonia Wu#7154|[CodePen](https://codepen.io/YUJOU/pen/vYryLwJ?editors=1111)|
|Karen Chan#4625|[CodePen](https://codepen.io/ruruchan7/pen/NWzjXqP)|
|meimei#9524|[CodePen](https://codepen.io/isnrudav/pen/poKrYpq?editors=1111)|
|yuchenye#6119|[CodePen](https://codepen.io/yuchen/pen/yLEzLPG)|
|Baozi#2042|[CodePen](https://codepen.io/lillianyu/pen/xxzpXVd)|
samger#0808|[CodePen](https://codepen.io/lee-wei-hong/pen/ZERVjax?editors=1111)|


