How do I create an array, which increments up to a certain number?(如何创建一个递增到一定数量的数组?)
For example, I have a variable, with the value of 3:(例如,我有一个变量,其值为3:)
const totalNumber = 3;
Is it possible, to convert this to an array, but the array increments from every number, up to and including 3?(是否可以将其转换为数组,但数组从每个数字开始递增,一直到3,包括3?)
For example, I would want the out put to be:(例如,我希望输出为:)
[1,2,3]
So if the value was 10 , output would be:(因此,如果值为10 ,则输出为:)
[1,2,3,4,5,6,7,8,9,10]
ask by Reena Verma translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…