JS Data Conversion

Introduction
When working with javascript, you can be able to convert data from one type to another, below are examples of different methods of data conversion.

parseInt
This function is used to convert data from a different data type to integer data type.

Example:  var x; x=parseInt(prompt("Enter a value for X")); document.write("The square of x is"+x*x);

parseFloat
This function is used to convert data from a different data type to floating point data type.

Example:  var x; x=parseFloat(prompt("Enter a value for X")); document.write("The square of x is"+x*x);

parseString
This function is used to convert data from a different datatype to string datatype.

Example:  var x; x=parseString(prompt("Enter a value for X")); document.write("The concatenation of x is"x&x);

parseBool
It is a function used to return the result as a boolean output e.g 1 or 0 i.e true or false