pull/63/head
Asabeneh 5 years ago
parent 55d651a19c
commit 5713a23e1d

@ -601,11 +601,15 @@ const users = [
### Exercises: Level 3 ### Exercises: Level 3
1. Destructure the countries object print name, capital, population and languages of all countries 1. Destructure the countries object print name, capital, population and languages of all countries
2. A junior developer structure student name, skills and score in array of arrays which may not easy to read. Destruction the following array name to name, skills array to skills, scores array to scores, JavaScript score to jsScore and React score to reactScore variable. 2. A junior developer structure student name, skills and score in array of arrays which may not easy to read. Destructure the following array name to name, skills array to skills, scores array to scores, JavaScript score to jsScore and React score to reactScore variable in one line.
```js ```js
const student = ['David', ['HTM', 'CSS', 'JS', 'React'], [98, 85, 90, 95]] const student = ['David', ['HTM', 'CSS', 'JS', 'React'], [98, 85, 90, 95]]
console.log(name, skills, scores, jsScore, reactScore) console.log(name, skills, jsScore, reactScore)
```
```sh
David (4) ["HTM", "CSS", "JS", "React"] 90 95
``` ```
3. Write a function called *convertArrayToObject* which can convert the array to a structure object. 3. Write a function called *convertArrayToObject* which can convert the array to a structure object.

@ -454,29 +454,28 @@ distance = 12
``` ```
```sh ```sh
[(6, 'love'), [{'love':6},
(5, 'you'), {'you':5},
(3, 'can'), {'can':3},
(2, 'what'), {'what':2},
(2, 'teaching'), {'teaching':2},
(2, 'not'), {'not':2},
(2, 'else'), {'else':2},
(2, 'do'), {'do':2},
(2, 'I'), {'I':2},
(1, 'which'), {'which':1},
(1, 'to'), {'to':1},
(1, 'the'), {'the':1},
(1, 'something'), {'something':1},
(1, 'if'), {'if':1},
(1, 'give'), {'give':1},
(1, 'develop'), {'develop':1},
(1, 'capabilities'), {'capabilities':1},
(1, 'application'), {'application':1},
(1, 'an'), {'an':1},
(1, 'all'), {'all':1},
(1, 'Python'), {'Python':1},
(1, 'If') {'If':1}]
]
``` ```
```js ```js
@ -484,17 +483,16 @@ distance = 12
``` ```
```sh ```sh
[ (6, 'love'), [{'love':6},
(5, 'you'), {'you':5},
(3, 'can'), {'can':3},
(2, 'what'), {'what':2},
(2, 'teaching'), {'teaching':2},
(2, 'not'), {'not':2},
(2, 'else'), {'else':2},
(2, 'do'), {'do':2},
(2, 'I'), {'I':2},
(1, 'which') {'which':1}]
]
``` ```
### Exercises: Level 3 ### Exercises: Level 3

@ -1,17 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>30DaysOfJavaScript:11 Day </title>
</head>
<body>
<h1>30DaysOfJavaScript:11 Day</h1>
<h2>Destructuring and Spread</h2>
<script src="./data/countries_data.js"></script>
<script src="./scripts/main.js"></script>
</body>
</html>

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<title>30DaysOfJavaScript:19 Day </title>
</head>
<body>
<h1>30DaysOfJavaScript:19 Day</h1>
<h2>Writing clean code</h2>
<script src="./scripts/main.js"></script>
</body>
</html>
Loading…
Cancel
Save