This is a built-in numeric type. There are an enormous amount of methods we can use with the number. I am listing something mostly used and important number methods:
If we start from the very beginning and most used debug tool which is the console.
// which is equal to 2 which gives the value of 2, not 2.5.
Therefore, if we want to get the upper closest or the lower closest value we’ll use Math.ceil and Math. floor respectfully.
// which is equal to 2
// which is equal to 3
This is used to manipulate a queue of characters. Useful for holding data that can be represented in text format.
// which give the output ‘a’ as it starts the count from 0 and in 1st index position there is ‘a’
Apart from this .toUpperCase() and .toLowerCase() methods give output in all characters of string in upper case and lower case respectfully.
// which gives the value ‘RAUFU’
// which gives the value “raufu”
This is used to keep elements of any type-together.
const names = [‘Raufu’, ‘Prezens’] console.log(names.length);
// which gives the value 2 that is basically the total number of elements in the array.
// which gives the value Raufu as it is in the first position.
This is built and has methods for mathematical functions. It basically works with the Number type.
Math.abs(a); returns the value of a in absolute form Math.random(); returns random value everytime it is called
I will try to update the article later and thank you for reading this article.