i'm new to JavaScript. Im trying to make a loop that prints every month and also numbers them, but i end up getting a concatenation of the numbers. here's my code
var months = ['january', 'february', 'march','april',
'may', 'june', 'july', 'august',
'september', 'october', 'november, 'december'];
for(i in months){
document.write((i+1)+'.- '+months[i]);
document.write('<br >')
}
and my output is like this:
01.- janury
11.- february
21.- march
.... etc