Skip to content

Latest commit

 

History

History
30 lines (17 loc) · 716 Bytes

File metadata and controls

30 lines (17 loc) · 716 Bytes
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 5 column 66
---

# STRING LENGTH

You will often need to know how many characters are in a string.

For this you will use thing `.length` property. Here's an example:

```js
var example = 'example string';
example.length
```

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.

Create a file named string-length.js.

In that file, create a variable named `example`.

**Make the `example` variable reference the string `example string`.**

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`

---