var result = 10;
This variable is numerical variable because the numerical value 42 was assigned to it. To convert to textural variable or string variable, you can assign a string value to it.
var result = "Have a nice weekend!";
var x = "The result is: " + 10;
If you want to convert a string that contain numerical characters to integer type and float type you can use parseInt() and pareFloat() respectively.
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: