JavaScript - number
// there are no separate types for integers and floating points numbers in JS // only one type for both is used i.e. 'number' // when you assign some variable or constant a number, its type become number let num1 = 10; console.log('value of num1 = ' + num1); console.log('typoe of num1 = ' + typeof num1); // though above used syntax is more common, but we can create // a number type variable using Number function too. like below: // below syntax is useful when you want to create 'number' variable // from string or others. we can pass that to Number function. let num2 = Number(20); console.log('num2 = ' + num2); // we can call this method passing string and other types too // in case of other types, its string equivalent would be used // to create number. num2 = Number("30"); console.log('now value of num2 = ' + num2); // like string, primitive type 'number' has also a corresponding // wrapper reference type i.e.