What should you know about JavaScript as an intermediate-level programmer?

Md. Masud Rana
4 min readMay 5, 2021

Today I’m gonna tell you some secrets about JavaScript to become a world-class programmer. I know you are a beginner JavaScript programmer. And you want to become a world-class developer. That’s the reason you are here.

1. String.prototype.endsWith()

The endsWith() method is a String Property. The method is to determine whether the string end with the characters of a specified string.
If the end of the characters are the same when you compare it returns true.
If not return false. The endsWith method is case sensitive.

2. String.prototype.lastIndexOf()

The lastIndexOf() returns the last occurrence of a substring in a string.
If the search term does not match with the paragraph. It returns -1. That I mention in the example. I tell you in short if the search value is not the main string the output should return -1.

3. String.prototype.replace()

The replace() method is used when you need to replace a value with a string.
The result is returned with the replacement value. The example is given, the output is to replace the fox with a monkey.

4. String.prototype.trim()

The trim() method is used for removing white space for both its beginning and end from the string. If the string has any white space from the beginning and the end it will remove it.

5. Math.ceil()

The Math.ceil() is a function that always rounds the number up to the next largest integer number.

6. Math.random()

The Math.random() is a function that returns a floating, random number in the 0 to less dan 1. When you want a random number you can use the random() function.

7. Array.prototype.concat()

The concat() method is used to merge two or more arrays. If you want to merge the value of two or more arrays you can use concat method. The method does not change the existing array it will return a new array.

8. Array.prototype.slice()

The array slice is a method that returns a shallow copy of a portion of an array into a new array object selected from start to end. It slices the array that you want. For example, you want to remove the last value of the ArrayList you just use arrayName.slice( position of the array ) that you want to remove.

9. Array.prototype.splice()

The Splice() method changes the contents of the array by remove or replaces the value of the array. It specifies the array value and adds or removes or replaces the values.

10. Array.prototype.shift()

The array shift is a fun thing. If you want to remove the first value from an array you can use shift() method. It will change the array list. Just remove the first value.

That’s for today I will catch you in the next one.

--

--