Practice Problem: Find the Length

Test Your Knowledge

Now that we know how to find the length of a string, let's find the length of a couple different strings. Below is a list of 5 different strings. Find the length of each string and log it to the console. The 4th string contains just spaces and the last string doesn't contain any characters.

  1. 'hello'
  2. '134123049385498509834134'
  3. 'I like food.'
  4. ' '
  5. ''