Skip to content

Commit 6e467ba

Browse files
committed
day 18
2 parents 0d45c6f + 8068378 commit 6e467ba

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

12_Day/12_day_regular_expressions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ Zero or many times. The pattern could may not occur or it can occur many times.
350350

351351
const pattern = /[a].*/g //. any character, + any character one or more times
352352
const txt = 'Apple and banana are fruits'
353-
const matches = re.match(pattern)
353+
const matches = txt.match(pattern)
354354

355355
console.log(matches) // ['and banana are fruits']
356356

@@ -383,7 +383,7 @@ console.log(matches) // ['2019']
383383

384384
```js
385385
const txt = 'This regular expression example was made in December 6, 2019.'
386-
const regex_pattern = /\d{1, 4}/g // 1 to 4
386+
const pattern = /\d{1,4}/g // 1 to 4
387387
const matches = txt.match(pattern)
388388
console.log(matches) // ['6', '2019']
389389
```
@@ -396,7 +396,7 @@ console.log(matches) // ['6', '2019']
396396
const txt = 'This regular expression example was made in December 6, 2019.'
397397
const pattern = /^This/ // ^ means starts with
398398
const matches = txt.match(pattern)
399-
console.log(matches) / ['This']
399+
console.log(matches) // ['This']
400400
```
401401

402402
- Negation
@@ -405,12 +405,12 @@ console.log(matches) / ['This']
405405
const txt = 'This regular expression example was made in December 6, 2019.'
406406
const pattern = /[^A-Za-z,. ]+/g // ^ in set character means negation, not A to Z, not a to z, no space, no coma no period
407407
const matches = txt.match(pattern)
408-
console.log(matches) ["6", "2019"]
408+
console.log(matches) // ["6", "2019"]
409409
```
410410

411411
### Exact match
412412

413-
It should hav ^ starting and $ which is an end.
413+
It should have ^ starting and $ which is an end.
414414

415415
```js
416416
let pattern = /^[A-Z][a-z]{3,12}$/;

15_Day/15_day_classes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,10 @@ class Person {
204204
}
205205

206206
const person1 = new Person() // it will take the default values
207-
const person1 = new Person('Lidiya', 'Tekle', 28, 'Finland', 'Espoo')
207+
const person2 = new Person('Lidiya', 'Tekle', 28, 'Finland', 'Espoo')
208208

209209
console.log(person1)
210+
console.log(person2)
210211
```
211212

212213
```sh

16_Day/16_day_json.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ const users = {
327327
}
328328
}
329329

330-
const text = JSON.stringify(users, undefined, 4)
331-
console.log(text) // text means JSON- because json is a string form of an object.
330+
const txt = JSON.stringify(users, undefined, 4)
331+
console.log(txt) // text means JSON- because json is a string form of an object.
332332
```
333333

334334
```sh
@@ -446,8 +446,8 @@ const user = {
446446
points: 30
447447
}
448448

449-
const text = JSON.stringify(user,['firstName', 'lastName', 'country', 'city', 'age'],4)
450-
console.log(text)
449+
const txt = JSON.stringify(user,['firstName', 'lastName', 'country', 'city', 'age'],4)
450+
console.log(txt)
451451
```
452452

453453
```sh
@@ -594,4 +594,4 @@ const text = `{
594594

595595
🎉 CONGRATULATIONS ! 🎉
596596

597-
[<< Day 15](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/15_Day/15_day_classes.md) | [Day 17 >>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/17_Day/17_day_web_storage.md)
597+
[<< Day 15](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/15_Day/15_day_classes.md) | [Day 17 >>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/17_Day/17_day_web_storage.md)

0 commit comments

Comments
 (0)