javascript - Create Simple Dynamic Array

前端 未结 16 1982
刺人心
刺人心 2020-12-14 06:53

What\'s the most efficient way to create this simple array dynamically.

var arr = [ \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"];
<         


        
16条回答
  •  伪装坚强ぢ
    2020-12-14 07:16

    The same way you would for all arrays you want to fill dynamically. A for loop. Suedo code is

    arr =array()
    for(i; i

    that should help you on the way

提交回复
热议问题