I had this question about arrays in JavaScript.
I couldn’t really find an answer. maybe i din look harder, i did look hard enough. or maybe i missed it in the book i am using as my reference.
I had an array and tried to push in quotes.
var quotes =[];
quotes.push("It has become appallingly obvious that our technology has exceeded
our humanity - Albert Einstein") /*i placed it on the second line to make
it more readable*/
This gave me an error. it did not state what error it was. I was going crazy thinking what could it be? i mean, what could i be missing in these 2 lines of code.
Then i placed it all on the same line and guess what, yes no more error. =_=
Can someone enlighten me on why? Or am i missing out on the obvious here.
Any response appreciated.
Thank you
Try: