I have a years range stored into two variables. I want to create an array of the years in the range.
something like:
var yearStart = 2000;
var yearEnd = 2040;
var arr = [];
for (var i = yearStart; i < yearEnd; i++) {
var obj = {
...
};
arr.push(obj);
}
What should I put inside the obj ?
The array I'd like to generate would be like:
arr = [2000, 2001, 2003, ... 2039, 2040]
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…