--- tags: 30 天軟體工程師體驗營|2025 --- # 🏅 JS 任務 Day12 - 函式、陣列、物件讀取 > 建議觀看的影音章節: > JS - 陣列教學 > JS - 物件教學 ### 題目一: 函式 return 物件 ``` =JavaScript // input 輸入 a().hi a().sayYo a().cry // output 輸出 "hi" "yo~" "嗚嗚" ``` ### 題目二:陣列包函式 ``` =JavaScript // input 輸入 b[0](3) b[0](4) // output 輸出 "你輸入的是3" "你輸入的是4" ``` ### 題目三:物件包函式 ``` =JavaScript // input 輸入 obj.a() obj.b() // output 輸出 "你執行的是 a 函式" "你執行的是 b 函式" ``` ### 題目四:進階題,不適合新手:arguments return function ```=JavaScript // input 輸入 sum(4,5) sum(4)(5) sum(7,9) sum(7)(9) // output 輸出 9 9 16 16 ``` ## 回報流程 1. 將答案貼在 Codepen 並複製 Codepen 連結貼至「回報區」回報 (也可以將答案直接貼至「回報區」)  <!-- 解答: 題目一: function a() { return { hi: "hi", sayYo: "yo~", cry: "嗚嗚" }; } 題目二: const b = [ function(n) { return `你輸入的是${n}`; } ]; 題目三: const obj = { a: function() { return "你執行的是 a 函式"; }, b: function() { return "你執行的是 b 函式"; } }; 題目四: function sum(a, b) { if (typeof b === "undefined") { return function(c) { return a + c; }; } else { return a + b; } } --> 回報區 --- | 報數 | Discord 名字 | Codepen/其他回饋| |:----:|:-------------------:|:---------------------------------------------------------------------------------------------------------------------------------:| |1|小趴|[Codepen](https://codepen.io/papa2415/pen/ExzapyL)| | 2 | SeanLuTW | [Codepen](https://codepen.io/sean85914/pen/ZYYVazo) | | 3 | 4chan | [Codepen](https://codepen.io/ijuolaqc-the-looper/pen/NPPeaMr?editors=1011) | | 4 | dean| [Codepen](https://codepen.io/ch933114/pen/MYYZOaG?editors=0011) | | 5 | 7Lun | [Day-12 Codepen](https://codepen.io/mfyvqhsn-the-bold/pen/gbbZXjR?editors=0011) | | 6 | ying | [Codepen](https://codepen.io/Lara-Lin/pen/GggPyyG?editors=1111) | | 7 | Ariel | [Codepen](https://codepen.io/ariel0510/pen/gbbZvRV?editors=0011) | | 8 | Ali | [Codepen](https://codepen.io/Alicia1117/pen/VYYqQjE) | | 9 | pastor | [Codepen](https://codepen.io/peter_hung/pen/gbbZeKW) | | 10 | 馬德 | [Codepen](https://codepen.io/maywang/pen/raaodqg?editors=0012) | | 11 | 登登登 | [Codepen](https://codepen.io/Duncanin/pen/dPPwKYj) | | 12 | oyll | [Codepen](https://codepen.io/dizzydog-rgb/pen/OPPrwEj?editors=0011) | | 13 | WEIWEI | [Codepen](https://codepen.io/weiwei93/pen/OPPrOVb) | | 14 | RUDY | [Codepen](https://codepen.io/Rudy-crw/pen/myyaQLO?editors=0010) | |15|蛋殼|[Codepen](https://codepen.io/weybrian/pen/yyyGGyw) | 16 | 牛奶 | [Codepen](https://codepen.io/0omilko0/pen/gbbZZEQ?editors=0011) | | 17 | ann.328 | [Codepen](https://codepen.io/yqmegupa-the-styleful/pen/EaaGrGR) | |18|Saika|[Codepen](https://codepen.io/saika4501/pen/raaoPzz?editors=1100)| | 19 | nora_zizi| [Codepen](https://codepen.io/Nora-Ch/pen/RNNEOrZ?editors=1111) | | 20 | mercury2508. | [Codepen](https://codepen.io/Mercury2508/pen/wBBRNZW) | | 21 | Sonia | [Codepen](https://codepen.io/YUJOU/pen/gbbZJdO?editors=0012) | | 22 | Leonard | [Codepen](https://codepen.io/hyyfjqra-the-sans/pen/VYYgwgj) | | 23 | 姜承 | [Codepen](https://codepen.io/Troy0718/pen/eYPjXqB?editors=0012) | | 24 | Hugh | [Codepen](https://codepen.io/Hugh-Chen/pen/PwwXGQx) | | 25 | 叮咚 | [Codepen](https://codepen.io/pinchieh-lin/pen/emmxZME?editors=1111) | | 26 | B | [Codepen](https://codepen.io/Babel777/pen/zxxeqWp) | | 27 | Chuang | [Codepen](https://codepen.io/uidoytjq-the-solid/pen/zxxeBPe?editors=0011) | | 28 | William Hsieh | [Codepen](https://codepen.io/lsaimqxa-the-vuer/pen/NPPowjj?editors=0012) | | 29 | 力文 | [Codepen](https://codepen.io/liwenchiou/pen/dPPadvK?editors=1111) | |30|JHT|[Codepen](https://codepen.io/juanht/pen/PwwVzep?editors=0012)| |31|WAWATA|[Codepen](https://codepen.io/wa-wa-GNOHC-WA-Wa/pen/OPProMZ)| | 32 | CBK |[Codepen](https://codepen.io/BK-C-the-styleful/pen/qEEvmdm)| | 33 | jingle0900 |[Codepen](https://codepen.io/EvaLi0472/pen/pvvqaEE?editors=1111)| | 34 | wei_0982 |[Codepen](https://codepen.io/nico-lai/pen/raaPeww)| | 35 | tung |[Codepen](https://codepen.io/oltsegon-the-looper/pen/qEEgQzB)| | 36 | Jessie_Yu | [Jessie_Yu 的 Codepen](https://codepen.io/bakyfkso-the-looper/pen/jEERaEb)| | 37 | BL | [Codepen](https://codepen.io/bonnieli1414/pen/KwwLapp)| | 38 | kelsonhouse | [Codepen](https://codepen.io/Kelson-House/pen/azzrwqq?editors=0011) | | 39 | ArvinSu | [Codepen](https://codepen.io/Arvin-Su/pen/JoogWGL) | | 40 | allen3290 | [Codepen](https://codepen.io/udadkudw-the-looper/pen/LEEwJPQ?editors=1111) | | 41 | ja4071 | [Codepen](https://codepen.io/SHAO-L/pen/zxxgLgw?editors=1112)| | 42 | vima | [Codepen](https://codepen.io/chin7004/pen/WbbVYaq) | | 43 | Rogan | [Codepen](https://codepen.io/RoganHsu/pen/QwbwwEP?editors=1111) | | 44 | Yi-Kuei | [Codepen](https://codepen.io/Yi-Kuei-Chuang/pen/raVxaJg?editors=1112) | | 45 | xiaocai_97765 | [Codepen](https://codepen.io/dupre55667788/pen/myJPpRe?editors=0010) | 46 | ninii | [Codepen](https://codepen.io/niiniiii/pen/wBaWxpb?editors=1111) | 47 | taishan_90178 | [Codepen](https://codepen.io/candy99/pen/XJbeWLY?editors=0012) | 48 | haohaoliao | [Codepen](https://codepen.io/yuyuyuhaohao/pen/jEWmEKv?editors=0012) | <!--【快速複製】 | num | user | [Codepen]() | -- >
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up