生成連續數字陣列


Posted by mijouhsieh on 2023-04-14

const number = Array.from(Array(count).keys())
生成一個長度為 count 的連續數字陣列。
假設 count 是 7,那麼 number 就是 [0, 1, 2, 3, 4, 5, 6]。

Array.from()
Array(count).keys()


#generate-consecutive-numbers







Related Posts

[31] 範疇 - 編譯三步驟、巢狀範疇、錯誤

[31] 範疇 - 編譯三步驟、巢狀範疇、錯誤

後端軟體工程工具箱:資料庫/SQL/ORM篇

後端軟體工程工具箱:資料庫/SQL/ORM篇

筆記、[FE101] 前端基礎 盒模型與定位

筆記、[FE101] 前端基礎 盒模型與定位


Comments