0
Why the below code won't execute!??it was written in w3schools and working well!!!
var names = new array("jenifer", "alex", "susan"); document.write(names[0]);
7 Answers
+ 3
array and Array are not same in javascript. it is case sensitive.
fix it..working fine.
+ 1
is it not working in code playground?
+ 1
write Array
+ 1
https://code.sololearn.com/W1M4dphA12a4/?ref=app
sorry wrong link earlier
+ 1
var names = new Array("jenifer", "alex", "susan");
document.write(names[0]);
raj Kumar is right you need to change array to Array
+ 1
First: js is case-sensitive so "new Array".
Second: eval is evil here) document.write writes here after the page is "completed". This code (see the First) gonna work in browser in tags script, but u cannot execute it on loaded page as a function
0
raj kumar chauhan no it doesn't