diff --git a/index.html b/index.html index 6c02505..1a2a536 100644 --- a/index.html +++ b/index.html @@ -15,6 +15,7 @@ - + + diff --git a/solutions/day-01/countries.js b/solutions/day-01/countries.js new file mode 100644 index 0000000..46aafa1 --- /dev/null +++ b/solutions/day-01/countries.js @@ -0,0 +1,13 @@ +export const countries = [ + "Albania", + "Bolivia", + "Canada", + "Denmark", + "Ethiopia", + "Finland", + "Germany", + "Hungary", + "Ireland", + "Japan", + "Kenya", +]; diff --git a/solutions/day-01/level1.js b/solutions/day-01/level1.js index e7e4347..997b27e 100644 --- a/solutions/day-01/level1.js +++ b/solutions/day-01/level1.js @@ -1,4 +1,4 @@ -// Exercise - Level 1 +// Array Exercise - Level 1 const arr = Array(); console.log(arr); diff --git a/solutions/day-01/main.js b/solutions/day-01/main.js new file mode 100644 index 0000000..7a4395a --- /dev/null +++ b/solutions/day-01/main.js @@ -0,0 +1,48 @@ +// Array Exercise - Level 2 + +import { countries } from "./countries.js"; +import { webTechs } from "./web_techs.js"; + +console.log("hiii"); + +console.log(webTechs.toString()); +console.log(webTechs.length); + +const shoppingCart = ["Milk", "Coffee", "Tea", "Honey"]; + +shoppingCart.unshift("Meat"); +console.log(shoppingCart); + +shoppingCart.push("Sugar"); +console.log(shoppingCart); + +shoppingCart.splice(4, 1); +console.log(shoppingCart); + +shoppingCart[3] = "Green Tea"; +console.log(shoppingCart); + +let countryTester = (country) => { + countries.includes(country) + ? console.log(country.toUpperCase()) + : (countries.push(country), console.log(countries)); +}; + +countryTester("Greece"); +countryTester("South Africa"); +countryTester("Ethiopia"); + +let webTechChecker = (tech) => { + webTechs.includes(tech) + ? console.log(tech.toString("Sass is a CSS preprocess")) + : (webTechs.push(tech), console.log(webTechs)); +}; + +webTechChecker("Sass"); + +const frontEnd = ["HTML", "CSS", "JS", "React", "Redux"]; +const backEnd = ["Node", "Express", "MongoDB"]; + +const fullStack = [frontEnd, backEnd]; + +console.log(fullStack); diff --git a/solutions/day-01/web_techs.js b/solutions/day-01/web_techs.js new file mode 100644 index 0000000..ee989af --- /dev/null +++ b/solutions/day-01/web_techs.js @@ -0,0 +1,9 @@ +export const webTechs = [ + "HTML", + "CSS", + "JavaScript", + "React", + "Redux", + "Node", + "MongoDB", +];