Skip to content

Commit 546fb71

Browse files
committed
day 16 fixes
1 parent e3b022f commit 546fb71

File tree

1 file changed

+122
-0
lines changed

1 file changed

+122
-0
lines changed

16_Day/16_day_json.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,12 +464,134 @@ console.log(text)
464464

465465
## Exercises
466466

467+
```js
468+
const skills = ['HTML', 'CSS', 'JS', 'React','Node', 'Python']
469+
let age = 250;
470+
let isMarried = true
471+
const student = {
472+
firstName:'Asabeneh',
473+
lastName:'Yetayehe',
474+
age:250,
475+
isMarried:true,
476+
skills:['HTML', 'CSS', 'JS', 'React','Node', 'Python', ]
477+
}
478+
const text = `{
479+
"Alex": {
480+
"email": "alex@alex.com",
481+
"skills": [
482+
"HTML",
483+
"CSS",
484+
"JavaScript"
485+
],
486+
"age": 20,
487+
"isLoggedIn": false,
488+
"points": 30
489+
},
490+
"Asab": {
491+
"email": "asab@asab.com",
492+
"skills": [
493+
"HTML",
494+
"CSS",
495+
"JavaScript",
496+
"Redux",
497+
"MongoDB",
498+
"Express",
499+
"React",
500+
"Node"
501+
],
502+
"age": 25,
503+
"isLoggedIn": false,
504+
"points": 50
505+
},
506+
"Brook": {
507+
"email": "daniel@daniel.com",
508+
"skills": [
509+
"HTML",
510+
"CSS",
511+
"JavaScript",
512+
"React",
513+
"Redux"
514+
],
515+
"age": 30,
516+
"isLoggedIn": true,
517+
"points": 50
518+
},
519+
"Daniel": {
520+
"email": "daniel@alex.com",
521+
"skills": [
522+
"HTML",
523+
"CSS",
524+
"JavaScript",
525+
"Python"
526+
],
527+
"age": 20,
528+
"isLoggedIn": false,
529+
"points": 40
530+
},
531+
"John": {
532+
"email": "john@john.com",
533+
"skills": [
534+
"HTML",
535+
"CSS",
536+
"JavaScript",
537+
"React",
538+
"Redux",
539+
"Node.js"
540+
],
541+
"age": 20,
542+
"isLoggedIn": true,
543+
"points": 50
544+
},
545+
"Thomas": {
546+
"email": "thomas@thomas.com",
547+
"skills": [
548+
"HTML",
549+
"CSS",
550+
"JavaScript",
551+
"React"
552+
],
553+
"age": 20,
554+
"isLoggedIn": false,
555+
"points": 40
556+
},
557+
"Paul": {
558+
"email": "paul@paul.com",
559+
"skills": [
560+
"HTML",
561+
"CSS",
562+
"JavaScript",
563+
"MongoDB",
564+
"Express",
565+
"React",
566+
"Node"
567+
],
568+
"age": 20,
569+
"isLoggedIn": false,
570+
"points": 40
571+
}
572+
}
573+
`
574+
```
575+
467576
### Exercises Level 1
468577

578+
1. Change skills array to JSON using JSON.stringify()
579+
580+
1. Stringify the age variable
581+
582+
1. Stringify the isMarried variable
583+
584+
1. Stringify the student object
585+
469586
### Exercises Level 2
470587

588+
1. Stringify the students object with only firstName, lastName and skills properties
589+
471590
### Exercises Level 3
472591

592+
1. Parse the *text* JSON to object.
593+
2. Find the the user who has many skills.
594+
473595
🎉 CONGRATULATIONS ! 🎉
474596

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

0 commit comments

Comments
 (0)