Skip to content

Commit 0bbec29

Browse files
authored
Merge pull request #158 from fuchodeveloper/patch-1
updated article.md
2 parents e8eeab1 + aa43393 commit 0bbec29

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

1-js/05-data-types/03-string/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ alert( str.indexOf("id") ); // 1, "id" is found at the position 1 (..idget with
236236

237237
The optional second parameter allows to search starting from the given position.
238238

239-
For instance, the first occurence of `"id"` is at the position `1`. To look for the next occurence, let's start the search from the position `2`:
239+
For instance, the first occurrence of `"id"` is at the position `1`. To look for the next occurrence, let's start the search from the position `2`:
240240

241241
```js run
242242
let str = 'Widget with id';
@@ -245,7 +245,7 @@ alert( str.indexOf('id', 2) ) // 12
245245
```
246246

247247

248-
If we're interested in all occurences, we can run `indexOf` in a loop. Every new call is made with the position after the previous match:
248+
If we're interested in all occurrences, we can run `indexOf` in a loop. Every new call is made with the position after the previous match:
249249

250250

251251
```js run
@@ -295,7 +295,7 @@ if (str.indexOf("Widget")) {
295295

296296
The `alert` in the example above doesn't show, because `str.indexOf("Widget")` returns `0` (meaning that it found the match at the starting position). Right, but `if` considers that to be `false`.
297297

298-
So, we should actualy check for `-1`, like that:
298+
So, we should actually check for `-1`, like that:
299299

300300
```js run
301301
let str = "Widget with id";

0 commit comments

Comments
 (0)