Here is a list of javascript exercises on String that will help you build logic and write your own methods.

Javascript exercises on String : Welcome User

Get the first name and last name from the user using the prompt box and display a welcome message that says “Hello Parvez Ansari”

Javascript exercises on String : Compare Strings

Get two values from the user ‘password’ and ‘confirm password’ using the prompt box and display a message “Password validated” if both the values match else display the message “Password do not match”

Javascript exercises on string : Calculate the length of the string

Get an input from the user using the prompt box and display the length of the string.

e.g “Parvez Ansari” should output will be 13.

Do this by writing your own method. Do not use the string.length property

Javascript exercises on string : Reverse the string

Get an input from the user using the prompt box and reverse the string.

e.g “Parvez” should return “zevrap”.

Write your own method. Do not use the string.reverse() method

Javascript exercises on string : Find Palindrome

Get an input from the user and determine whether the string is palindrome.

Palindrome is a word, phrase, or sequence that reads the same backwards as forwards,

Examples of palindrome words “madam”, “level”, “radar”, “noon” and “malayalam”.

Javascript exercises on string : Find Vowels

Get an input from the user and strip out all the vowels.

The letters A, E, I, O, and U are called vowels.

eg. “I Love You” should return “lvy”

Javascript exercises on string : Capitalize String

Get an input from the user and convert it into Capitalize format.

eg. ‘london’ should return “London”

Got any feedback or suggestion.

If you have any suggestion or feedback, feel free to email me. Please spread the word by sharing this post if you find this helpful.