0
Does javascript allows datatype conversation? I need some examples
when I getting input from prompt window and I want to add them then the result shows after concat them
2 Answers
+ 1
Yes, you can change variable datatype in JavaScript.
Example:
prompt get input as string if you need integer etc, you can change it
var a=parceInt(prompt("Enter a value for A"));
The A variable data will be string if you need integer just add ParceInt before prompt box
+ 1
JavaScript Types are Dynamic. This means that the same variable can be used to hold different data types.
https://www.w3schools.com/js/js_datatypes.asp
https://www.w3schools.com/js/js_variables.asp