10 JavaScript string methods you should know

In this post, I will summarize 10 javascript string methods you should at least known according to me.

The string is anything inside single or double-quotes.
Here are 10 javascript string methods you should know.

  1. charAt()

Return character at a specified position.

2. includes()

Check if the string contains a specified character(s).

3. endsWith()

Check if the string ends with specified character(s).

4. slice()

Copy some parts of the string without modifying the original one.

5. toUpperCase()

Convert string into upper case.

6. toLowerCase()

Convert string into lower case.

7. split()

Split string into an array of substrings.

8. replace()

Replaces specified value with another value in a string.

9. repeat()

Return a new string with a specified number of copies of an existing string.

10. startsWith()

Check if the string starts with specified character(s).



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store