I'm completely new to javascript and recently encountered an issue where I needed an array containing numbers from 1 to 20.
To achieve this, I used the following code:
var numberArray = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
QUERY:
I can't help but wonder if this method is not the most efficient (and definitely not scalable). Is there a way to automatically generate an array with sequential values ranging between 1 and 20, or even up to 1000?