From 18052367231b424885864d9a54963eb8c69aaccd Mon Sep 17 00:00:00 2001 From: ardaninsaturnu Date: Tue, 12 Apr 2022 10:11:57 +0300 Subject: [PATCH] array exercise 2 finished. :smile: --- .../589173d9ef7a5af62ec2454107585f31eb8000a9 | 0 .idea/sonarlint/issuestore/index.pb | 4 +- 01_Day_JavaScript_Refresher/countries.js | 16 ++++++++ 01_Day_JavaScript_Refresher/index.html | 3 ++ 01_Day_JavaScript_Refresher/main.js | 39 +++++++++++++++++++ 01_Day_JavaScript_Refresher/web_tech.js | 11 ++++++ 6 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 .idea/sonarlint/issuestore/5/8/589173d9ef7a5af62ec2454107585f31eb8000a9 create mode 100644 01_Day_JavaScript_Refresher/countries.js create mode 100644 01_Day_JavaScript_Refresher/main.js create mode 100644 01_Day_JavaScript_Refresher/web_tech.js diff --git a/.idea/sonarlint/issuestore/5/8/589173d9ef7a5af62ec2454107585f31eb8000a9 b/.idea/sonarlint/issuestore/5/8/589173d9ef7a5af62ec2454107585f31eb8000a9 new file mode 100644 index 0000000..e69de29 diff --git a/.idea/sonarlint/issuestore/index.pb b/.idea/sonarlint/issuestore/index.pb index 04e8b0a..6c2b4c1 100644 --- a/.idea/sonarlint/issuestore/index.pb +++ b/.idea/sonarlint/issuestore/index.pb @@ -1,3 +1,5 @@ 9 - readMe.md,2/1/21e750cb5a54cdc4855496cd8fcadefd187f9682 \ No newline at end of file + readMe.md,2/1/21e750cb5a54cdc4855496cd8fcadefd187f9682 +h +802_Day_Introduction_to_React/02_introduction_to_react.md,5/8/589173d9ef7a5af62ec2454107585f31eb8000a9 \ No newline at end of file diff --git a/01_Day_JavaScript_Refresher/countries.js b/01_Day_JavaScript_Refresher/countries.js new file mode 100644 index 0000000..b572cb5 --- /dev/null +++ b/01_Day_JavaScript_Refresher/countries.js @@ -0,0 +1,16 @@ +const countries = [ + 'Albania', + 'Bolivia', + 'Canada', + 'Denmark', + 'Ethiopia', + 'Finland', + 'Germany', + 'Hungary', + 'Ireland', + 'Japan', + 'Kenya', +] + +export default countries; + diff --git a/01_Day_JavaScript_Refresher/index.html b/01_Day_JavaScript_Refresher/index.html index 87f1122..c5f631e 100644 --- a/01_Day_JavaScript_Refresher/index.html +++ b/01_Day_JavaScript_Refresher/index.html @@ -7,6 +7,7 @@ + \ No newline at end of file diff --git a/01_Day_JavaScript_Refresher/main.js b/01_Day_JavaScript_Refresher/main.js new file mode 100644 index 0000000..bfd08ba --- /dev/null +++ b/01_Day_JavaScript_Refresher/main.js @@ -0,0 +1,39 @@ +import webTechs from "./web_tech.js"; +import countries from "./countries.js"; + +console.log(webTechs); +console.log(countries); + +let text = + 'I love teaching and empowering people. I teach HTML, CSS, JS, React, Python.' + +const words = text.replaceAll(/[.,]/g,'').split(' '); +console.log(words,words.length); + +const shoppingCart = ['Milk', 'Coffee', 'Tea', 'Honey']; + +shoppingCart.push('Meat'); + +const addItem = (arr,item) => { + if( !arr.includes(item) ){ arr.push(item)}else { console.log(item.toUpperCase(),arr) }; +} + +addItem(shoppingCart,'Sugar') +addItem(shoppingCart,'Milk'); + +shoppingCart.splice(shoppingCart.indexOf('Honey'),1); +shoppingCart[shoppingCart.indexOf('Tea')] = 'Green Tea' + +console.log(shoppingCart) + +addItem(countries,'Ethiopia') + +const frontEnd = ['HTML', 'CSS', 'JS', 'React', 'Redux'] +const backEnd = ['Node', 'Express', 'MongoDB'] + +const fullStack = frontEnd.concat(backEnd) + +console.log(fullStack) + + + diff --git a/01_Day_JavaScript_Refresher/web_tech.js b/01_Day_JavaScript_Refresher/web_tech.js new file mode 100644 index 0000000..69e7c46 --- /dev/null +++ b/01_Day_JavaScript_Refresher/web_tech.js @@ -0,0 +1,11 @@ +const webTechs = [ + 'HTML', + 'CSS', + 'JavaScript', + 'React', + 'Redux', + 'Node', + 'MongoDB', +] + +export default webTechs; \ No newline at end of file