var sum = 4 + 2 ,
difference = 4 - 2 ,
multiply = 4 * 2 ,
divide = 4 / 2 ; // we assign here different values into var together.
alert(sum); // 4+2=6
alert(difference); // 4 - 2 = 2
alert(multiply); // 4 * 2 = 8
alert(divide); // 4 / 2 = 2
alert(sum * multiply); // 6 * 8 = 48
Example: Join two string together --
var foo = "hello world" +", " + " I am here for you!";
alert(foo); // hello world, I am here for you!
Example: Cascade 2 integers with a numeric string --
var foo = 2+3+"4" ; //Here 2 or 3 is integer but 4 is a numeric string so value return 2+3=5+("4") = 54
alert(foo); //we add two integer than join the integer string, because string and integer cant merge than answer return 54
one more this type of example--
var foo= 1+2+"3"+4+5; //here we get result 3345 because compiler calculate values from left to right so 1+2=3 than 3+"3"=33 after than complier read all values after string as string so 33+4=334 and 334+4= 3345=>>(final answer)
//alert(foo); // 3345
Example of parseInt :
var foo = parseInt("33", 10); //Return 33
var foo = parseInt("33.33" ,10); //Return 33
var foo = parseInt("s" ,10); //Return NaN means Not a number
Example of parseFloat :
var foo = parseFloat("3.14", 10);
alert(foo); // 3.14