JavaScript是否具备相似“ range()”的方法来在提供的范围内生成范围?

问题:

In PHP, you can do... 在PHP中,您能够... 函数

range(1, 3); // Array(1, 2, 3)
range("A", "C"); // Array("A", "B", "C")

That is, there is a function that lets you get a range of numbers or characters by passing the upper and lower bounds. 也就是说,有一个函数可让您经过传递上下限来得到必定范围的数字或字符。 ui

Is there anything built-in to JavaScript natively for this? 为此,JavaScript是否内置任何内置功能? If not, how would I implement it? 若是没有,我将如何实施? this


解决方案:

参考一: https://stackoom.com/question/GLOI/JavaScript是否具备相似-range-的方法来在提供的范围内生成范围
参考二: https://oldbug.net/q/GLOI/Does-JavaScript-have-a-method-like-range-to-generate-a-range-within-the-supplied-bounds
相关文章
相关标签/搜索