Exercise: Level 2

pull/62/head
Chrys-Nicolaides 5 years ago
parent 40ffd5ff03
commit 5f05a1547c

@ -15,6 +15,7 @@
<script src="./introduction.js"></script> <script src="./introduction.js"></script>
<script src="./helloworld.js"></script> <script src="./helloworld.js"></script>
<script src="./solutions/day-01/level1.js"></script> <!-- <script src="./solutions/day-01/level1.js"></script> -->
<script type="module" src="./solutions/day-01/main.js"></script>
</body> </body>
</html> </html>

@ -0,0 +1,13 @@
export const countries = [
"Albania",
"Bolivia",
"Canada",
"Denmark",
"Ethiopia",
"Finland",
"Germany",
"Hungary",
"Ireland",
"Japan",
"Kenya",
];

@ -1,4 +1,4 @@
// Exercise - Level 1 // Array Exercise - Level 1
const arr = Array(); const arr = Array();
console.log(arr); console.log(arr);

@ -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);

@ -0,0 +1,9 @@
export const webTechs = [
"HTML",
"CSS",
"JavaScript",
"React",
"Redux",
"Node",
"MongoDB",
];
Loading…
Cancel
Save