Skip to content

Commit 69e104b

Browse files
committed
<Add article about string length
1 parent 3e9e204 commit 69e104b

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

‎SUMMARY.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
* [Advanced Operators](numbers/advanced.md)
1111
* [Strings](strings/README.md)
1212
* [Creation](strings/create.md)
13-
* [Concatenation](strings/concat.md)
13+
* [Concatenation](strings/concat.md)
14+
* [Length](strings/length.md)

‎strings/length.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Length
2+
3+
It's easy in Javascript to know how many characters are in string using the property `.length`.
4+
5+
```js
6+
// Juste use the property .length
7+
var size = 'Our lovely string'.length;
8+
9+
```
10+
11+
**Note:** Strings can not be substracted, multiplied or divided.
12+
13+
---
14+
15+
Store in the variable named `size` the length of `str`.
16+
17+
```js
18+
var str = "Hello World";
19+
20+
var size =
21+
```
22+
23+
```js
24+
var str = "Hello World";
25+
26+
var size = str.length;
27+
```
28+
29+
```js
30+
assert(size == str.length);
31+
```
32+
33+
---

0 commit comments

Comments
 (0)