+ 2
Why zero ?
That's a code i sound of FreeCodeCamp to print out the length of a string, but why did they assign the value of "firstNameLength " to zero ? here's the code: var firstNameLength = 0; var firstName = "Ada"; firstNameLength = firstName.length;
3 ответов
+ 2
Normally you dont have to initialize variabiles in Java Script. But could be a good practice derived from languages like Java.
+ 1
That's hard to say without the context. Can you upload more of the code and link it here?