Javascript — 第 06天
IPFS
![](https://assets.matters.news/embed/c2816ed9-cd19-45de-879a-d3000543abf7.jpeg)
你可在github找到 source code | Here
本日主題
- 進階函式Advanced Function
- -閉包closure
- -currying
- -compose
- 進階陣列Advanced Arrays
- -forEach
- -mapArray
- -filter
- 進階物件Advanced Objects
- -reference type
- -context
- -instantiation
閉包Closure
- 一個函式執行
- 不會再跑一遍
- child scope會記得reference,可進入 parent scope
- 但parent scope 無法進入child scope
![](https://assets.matters.news/embed/0283c5b8-4bad-4901-b61f-b5c118806530.png)
![](https://assets.matters.news/embed/83b30293-fd85-41fc-8772-79e51017c393.jpeg)
Currying
![](https://assets.matters.news/embed/740f2c4f-cace-4bd7-922c-c475a298ecb8.png)
![](https://assets.matters.news/embed/5f9dd687-ead1-4b9e-a7ad-c36e246a8a86.jpeg)
Compose
![](https://assets.matters.news/embed/af575d48-81d7-4b67-b2e0-754f600f1274.png)
![](https://assets.matters.news/embed/ed8df67e-d173-4818-af4b-99e0e7ed892d.jpeg)
Advanced Arrays
forEach & mapArray 差異在於
mapArray總有回傳值(returned value)
forEach
![](https://assets.matters.news/embed/c003d582-68d7-4992-8630-092bb0200607.png)
![](https://assets.matters.news/embed/72864947-58ee-4dd7-be39-c99c22c9c979.jpeg)
mapArray
![](https://assets.matters.news/embed/16435028-5e69-4cbf-a51b-268d40d29cd3.png)
![](https://assets.matters.news/embed/8b87a9e8-c975-42ce-ad7d-84ec6d657a28.jpeg)
filter
![](https://assets.matters.news/embed/b781721b-5466-4a55-955b-e02c51cdc216.png)
![](https://assets.matters.news/embed/95fb89ad-2824-4dd7-8a23-79c394509a65.jpeg)
reduce
超好用💪
![](https://assets.matters.news/embed/a6bbe7cf-582e-475a-9394-075689aaebcc.png)
![](https://assets.matters.news/embed/3965a935-27d3-459a-900d-b4ed1a9bc7a1.jpeg)
進階物件advanced Object
reference type
![](https://assets.matters.news/embed/0d10bca3-78c9-4cc9-a578-e7695b2cdae3.png)
![](https://assets.matters.news/embed/6cc019f4-2c85-4a8c-86be-5b672c983705.jpeg)
context
就像是javascript環境
實例化instantiation
更多資訊 | MDN
![](https://assets.matters.news/embed/99aa3d30-5c84-46ad-9176-afbe5d591252.png)
![](https://assets.matters.news/embed/daff9962-edeb-4144-8048-0992224660ec.jpeg)
喜欢我的作品吗?别忘了给予支持与赞赏,让我知道在创作的路上有你陪伴,一起延续这份热忱!
![](https://imagedelivery.net/kDRCweMmqLnTPNlbum-pYA/prod/avatar/d817bb18-ddf9-48cf-8377-7ad47ca8c94a.jpeg/public)
- 来自作者
- 相关推荐