From 5713a23e1d557f8fe31a442a6fece29d3f8f6dfc Mon Sep 17 00:00:00 2001 From: Asabeneh Date: Tue, 21 Jan 2020 00:58:06 +0200 Subject: [PATCH] day 20 --- 11_Day/11_day_destructuring_and_spread.md | 8 ++- 12_Day/12_day_regular_expressions.md | 66 +++++++++---------- 20_Day/12_day_starter/index.html | 17 ----- .../data/countries_data.js | 0 20_Day/19_day_starter/index.html | 17 +++++ .../scripts/main.js | 0 6 files changed, 55 insertions(+), 53 deletions(-) delete mode 100644 20_Day/12_day_starter/index.html rename 20_Day/{12_day_starter => 19_day_starter}/data/countries_data.js (100%) create mode 100644 20_Day/19_day_starter/index.html rename 20_Day/{12_day_starter => 19_day_starter}/scripts/main.js (100%) diff --git a/11_Day/11_day_destructuring_and_spread.md b/11_Day/11_day_destructuring_and_spread.md index 60234bd4..75e8d4ce 100644 --- a/11_Day/11_day_destructuring_and_spread.md +++ b/11_Day/11_day_destructuring_and_spread.md @@ -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. diff --git a/12_Day/12_day_regular_expressions.md b/12_Day/12_day_regular_expressions.md index 676085a5..b65d2330 100644 --- a/12_Day/12_day_regular_expressions.md +++ b/12_Day/12_day_regular_expressions.md @@ -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 diff --git a/20_Day/12_day_starter/index.html b/20_Day/12_day_starter/index.html deleted file mode 100644 index 6efcab4f..00000000 --- a/20_Day/12_day_starter/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - 30DaysOfJavaScript:11 Day - - - -

30DaysOfJavaScript:11 Day

-

Destructuring and Spread

- - - - - - - \ No newline at end of file diff --git a/20_Day/12_day_starter/data/countries_data.js b/20_Day/19_day_starter/data/countries_data.js similarity index 100% rename from 20_Day/12_day_starter/data/countries_data.js rename to 20_Day/19_day_starter/data/countries_data.js diff --git a/20_Day/19_day_starter/index.html b/20_Day/19_day_starter/index.html new file mode 100644 index 00000000..f51dfe55 --- /dev/null +++ b/20_Day/19_day_starter/index.html @@ -0,0 +1,17 @@ + + + + + 30DaysOfJavaScript:19 Day + + + +

30DaysOfJavaScript:19 Day

+

Writing clean code

+ + + + + + + \ No newline at end of file diff --git a/20_Day/12_day_starter/scripts/main.js b/20_Day/19_day_starter/scripts/main.js similarity index 100% rename from 20_Day/12_day_starter/scripts/main.js rename to 20_Day/19_day_starter/scripts/main.js