It is perfectly legal to assign a number to a variable and then assign a string to the same variable as followsexamplei = 10;i = "string";This is called variable typing
Javascript
Topic: JS Variables
What is variable typing in javascript?
Browse random answers:
What is a JavaScript Variables?
How to create a JavaScript variable?
How to Re-Declaring JavaScript Variables?
What is the data type of variables of in JavaScript?
What is variable typing in javascript?
What is the difference between the below two statements:- (1) var myname = "Akiii"; (2) myname = "Akiii";
What’s the difference between these two statements:var x = 3;x = 3;