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;
Normally you dont have to initialize variabiles in Java Script. But could be a good practice derived from languages like Java.
That's hard to say without the context. Can you upload more of the code and link it here?
I think it's for safety if you not define 0 it will be undefined. And it's good practise to define variables.
BMI calculator code project
How to create a border
How do I delete my account?
please help me to solve it..