console.log()
- Output in the developer console.
var a = 50;
console.log(a);
- alert() - Output in the browser.
var a = 50;
alert(a);
prompt()
function is used to take input.
var lastQuestion;
lastQuestion = prompt("How long the universe will last?: ");
console.log(lastQuestion);
- From String To Number:
var strNum = "3.14";
var num = Number(strNum);
console.log(strNum);
console.log(num);
- From Number to String:
var num = 2.72;
var strNum = String(num);
console.log(num);
console.log(strNum);
TODO