Some of the basic concepts of JavaScript

Nahidul Islam
4 min readNov 2, 2020

String charAt method:

This method returns the character from the index value specified. They were indexed from left to right by these characters in a string. The first character’s index is 0, then the second character is 1, and so on.

This is the first character of the string example. Output Is “w”

Another thing is that the last index character in a string is string.length-1, string.length-2 is the second last character, and so on.

This is the last character of the string example. Output Is “u”

String includes() Method:

The include method determines if a string includes the character of a particular string. This method returns true if the character is included in the string and false if not. Here is the example below —

Method IndexOf):

The method indexOf () returns the position from the first word in a string of a value specified. Another thing is if the value to be checked for never matched, this method returns -1. Here is the example below —

Here, the position of the “Work “ first word is 17. The “Hello” word, on the other hand, did not match, so the output is -1.

Replace() Method:

This method searches the specific value and it has replaced the new value. Here is the example is given below — -

In this here “Hello” is replaced by “Hi”.

Slice() method:

You can use the slice method if you want to view a particular component, from the first parameter to the end parameter. For instance —

In this here, I want to show the index of 9 to 16, so the output is “ I Will “.

ToLocaleLowerCase() & ToLocalUpperCase() Method:

The toLocalLowerCase() method converts a string to lowercase letters; similarly, the toLocaleUpperCase() method converts a string to uppercase letters according to the current value.

Round, Ceil, Floor, and Random method:

The round method rounds with the nearest integer. The ceil() method rounds a float number to the nearest number upwards. The Floor method rounds a float number to the nearest number downwards. A number from 0 to 1. is returned by the Random method.

Here is an example is given below…

Concat() Method:

For joining two or more arrays, this method is used. It’s doesn’t change this method, it returns the existing new join array.

Filter and Find method:

If this condition is a match, all array elements that filter the condition return the filtered element. On the other hand, if there are no elements not matching the filtering condition, then the empty array is returned.

On the other hand, in the find method, which filters the condition of the array elements, the first matching value is returned if the condition matches.

Map() Method:

For each array element, the Map () method calls a function and returns all the elements. However, this method does not change the original array elements, nor does it execute an array element function that does not have values.

Thanks, everyone. I hope this blog helpful to every learner.

Happy JavaScript coding lover !!!

--

--

Nahidul Islam

AWS Certified Solutions Architect - Associate || DevOps Enthusiast || JavaScript Developer at SEBPO