Most usable default functions in JavaScript

Omar Faruk shakil
3 min readMay 5, 2021

--

These build-in functions are easy to use in JS coding. Every JavaScript developer or programmer should know that.

JavaScript has a lot of built-in functions and features for which it is famous a lot.JavaSript Developer should know these build-in functions as more as possible. Here, I will describe some important functions among them.

some string function:

  1. charAt(): The charAt function search the character at any position of a string. charAt() claim a decimal parameter for searching a character. If the parameter is longer than the string height then that will finds nothing.

2.String.length(): Sometimes It is an emergency need to know the size of the string or array especially when we think of loops through among them.The string. length or array. length function told us the size of the string or array.

3.string.replace(oldValue, newValue):

If you think to change any string or substring with other substrings that is not hard in javaScript because it has a default replace function. It receives two parameters, the first one is a current string and the last one is the new /alternative string.

4.string.toUpperCase() & toLowercase():

If you need to change a string between uppercase and lowercase. that is doing by using these two functions.

5.string.concat():

concat() function adds a string to another string by this function. Remember that concat is the simplification of concatenation that means append something to another string.

6.string.includes():

If you need to check your string that it contains any substring or not . Then you can find that easily by includes function. includes() capture a substring which checking in existing / main string.

7. slice:

slice() exploits a portion of string from existing string like cutting a slice of cake at keep out that for eat. It has two parameter, the first is starting index and the last is ending index of output string.

8.split:

It breaks string according to a separator which we provide as a parameter to this function. And it is possible to limit the parts of string.

9.substr():

It takes a parts from the existing string with its parameter. If you provide a single parameter that makes output string from 0 to that index.

10.toString():

It return a string data types from other data types of data.

--

--

Omar Faruk shakil
0 Followers

JavaScript Developer | Front End development Expert | Writer | Dreamer & Curious Learner