10 important JavaScript methods you need to know

Yusuf
3 min readMay 5, 2021

String-

01. charAt()

This JavaScript method returns the position of a letter inside a string, just by providing an index number. It starts counting from zero(0). Moreover, it also counts white spaces.

02. trim()

This method works like a trimmer and it removes all white spaces from codes both ends.

03. includes()

This method checks whether the existence of the provided string is that is it string or not. That means returning true or false.

Math-

04. parseInt()

This functional method returns a string and a number.

05. parseFloat()

This functional method converts an argument to a number from a string (if needed) and returns a float number.

06. Math.random()

Math.random() method is producing random numbers. When it is executed it returns a random number that can be between 0 and 1.

07. Math.ceil()

This method round up the inputting number and return its next largest integer number.

Array-

08. splice()

This method takes three-parameter. First it targeted index number, second how many times you want to update or replace and third parameter is what you want to insert.

09. reverse()

This method reverses an array. That means first element becomes last and last becomes first.

10. map()

The map() method creates a new array with the result of calling a provided function on every element in the calling array.

--

--