Notes
JavaScript has only one type of number. Numbers can be written with or without decimals.
A number without decimal.
let x = 12;
A number with decimal.
let y = 0.04;
Extra large or extra small numbers can be written with scientific (exponent) notation:
let x = 24e6 //24000000
let y = 2e-6 //0.000002
If you add two numbers, the result will be a number:
let x = 5;
let y = 12;
document.write(x+y) //17
If you add two strings, the result will be a string concatenation:
let x = '5';
let y = '3';
document.write(x+y) //53
If you add a number and a string, the result will be a string concatenation:
let x = 5;
let y = '3';
document.write(x+y) //53
If you add a string and a number, the result will be a string concatenation:
let x = '5';
let y = 3;
document.write(x+y) //53
JavaScript will try to convert strings to numbers in all numeric operations:
let x = '12';
let y = '3';
document.write(x/y) //12/3=4
document.write(x-y) //12-3=9
document.write(x*y) //12*3=36
Video
Video does not exists.