+ 2
Why my array is not work correctly?
It's given the first letter and not the first word... https://code.sololearn.com/WC8Kzs6RgEpX/?ref=app
3 Respuestas
+ 6
arieh
The reason you are getting just the letter of the name is that name is a property of the global object. A getter and setter to be exact. The getter returns a string, hence the reason for just the first letter of the string. To prove this for yourself add console.log(window.name) to the end of your code.
https://code.sololearn.com/WB7BGaIY4r74/#html
+ 3
var courses = ["HTML", "CSS", "JS"];
document.write(courses[2]);
var names = new Array("Arieh", "yeshoua");
document.write (names[0]);
This works fine
+ 3
Thank you.