JavaScript function similar to Python range()

前端 未结 24 1534
南旧
南旧 2020-11-30 21:17

Is there a function in JavaScript similar to Python\'s range()?

I think there should be a better way than to write the following lines every time:

24条回答
  •  有刺的猬
    2020-11-30 21:51

    You may use underscore library. It contains dozens of useful functions for working with arrays and many more.

提交回复
热议问题