+ 1
Datatypes in js
Can somebody explain how do the datatypes link to the functions.For example sometimes when i declare a variable and give it a string function it doesn't work until i convert it manually to string datatype.Why does this happen?
1 Réponse
+ 1
The data type is based on the last assignment to the variable. n = 5+3; makes n an integer ignoring the fact that it was initialized as a string with n = "12";