UNPKG

javascripting

Version:

Learn JavaScript by adventuring around in the terminal.

36 lines (19 loc) 740 B
--- # STRING LENGTH You will often need to know how many characters are in a string. For this you will use the `.length` property. Here's an example: ```js var example = 'example string'; example.length ``` #NOTE Make sure there is a period between `example` and `length`. The above code will return a **number** for the total number of characters in the string. ## The challenge: Create a file named `string-length.js`. In that file, create a variable named `example`. **Assign the string `'example string'` to the variable `example`.** Use `console.log` to print the **length** of the string to the terminal. **Check to see if your program is correct by running this command:** `javascripting verify string-length.js` ---