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

@ -601,11 +601,15 @@ const users = [
### Exercises: Level 3
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
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.

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