From 4f2d41d6f4022f0b5a667dfedb39bd8c1c9f326e Mon Sep 17 00:00:00 2001 From: Ashim Debnath Date: Wed, 5 Feb 2025 20:30:12 +0530 Subject: [PATCH] new files added --- solutions/day-01/countries.mjs | 14 ++++++++++ solutions/day-01/level2.mjs | 51 ++++++++++++++++++++++++++++++++++ solutions/day-01/level3.js | 0 solutions/day-01/web_techs.mjs | 10 +++++++ 4 files changed, 75 insertions(+) create mode 100644 solutions/day-01/countries.mjs create mode 100644 solutions/day-01/level2.mjs create mode 100644 solutions/day-01/level3.js create mode 100644 solutions/day-01/web_techs.mjs diff --git a/solutions/day-01/countries.mjs b/solutions/day-01/countries.mjs new file mode 100644 index 0000000..6e434fe --- /dev/null +++ b/solutions/day-01/countries.mjs @@ -0,0 +1,14 @@ +const countries = [ + 'Albania', + 'Bolivia', + 'Canada', + 'Denmark', + 'Ethiopia', + 'Finland', + 'Germany', + 'Hungary', + 'Ireland', + 'Japan', + 'Kenya', + ] + export default countries \ No newline at end of file diff --git a/solutions/day-01/level2.mjs b/solutions/day-01/level2.mjs new file mode 100644 index 0000000..c3f0cfe --- /dev/null +++ b/solutions/day-01/level2.mjs @@ -0,0 +1,51 @@ +import webTechs from "./web_techs.mjs"; +import countries from "./countries.mjs"; + +// console.log(webTechs) +// console.log(countries) + +let text = + 'I love teaching and empowering people. I teach HTML, CSS, JS, React, Python.' + + let words = text.split(" ") +console.log(words) +console.log(words.length) + +const shoppingCart = ['Milk', 'Coffee', 'Tea', 'Honey'] + +if(shoppingCart[0]!="Meat"){ + shoppingCart.unshift("Meat") +}console.log(shoppingCart) + +if(shoppingCart[shoppingCart.length-1]!="Sugar"){ + shoppingCart.push("Sugar") +}console.log(shoppingCart) + + +const Allergy = true + +if(Allergy==true){ + let i = shoppingCart.indexOf('Honey') + shoppingCart.splice(i,1) +}console.log(shoppingCart) + +let index = shoppingCart.indexOf('Tea') +shoppingCart[index] = 'Green Tea' +console.log(shoppingCart) + +if(countries.includes("Ethiopia")){ + console.log("ETHIOPIA") +}else{ + countries.push('Ethiopia') +} + +if(webTechs.includes('Sass')){ + console.log("sass is a css preprocessor") +}else{ + webTechs.push("Sass") +}console.log(webTechs) + +const frontEnd = ['HTML', 'CSS', 'JS', 'React', 'Redux'] +const backEnd = ['Node', 'Express', 'MongoDB'] +let fullStack = frontEnd.concat(backEnd) +console.log(fullStack) \ No newline at end of file diff --git a/solutions/day-01/level3.js b/solutions/day-01/level3.js new file mode 100644 index 0000000..e69de29 diff --git a/solutions/day-01/web_techs.mjs b/solutions/day-01/web_techs.mjs new file mode 100644 index 0000000..92d6ce6 --- /dev/null +++ b/solutions/day-01/web_techs.mjs @@ -0,0 +1,10 @@ +const webTechs = [ + 'HTML', + 'CSS', + 'JavaScript', + 'React', + 'Redux', + 'Node', + 'MongoDB', + ] + export default webTechs \ No newline at end of file