array exercise 2 finished. 😄

pull/162/head
ardaninsaturnu 3 years ago
parent c8b48c29fc
commit 1805236723

@ -1,3 +1,5 @@
9
readMe.md,2/1/21e750cb5a54cdc4855496cd8fcadefd187f9682
readMe.md,2/1/21e750cb5a54cdc4855496cd8fcadefd187f9682
h
802_Day_Introduction_to_React/02_introduction_to_react.md,5/8/589173d9ef7a5af62ec2454107585f31eb8000a9

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

@ -7,6 +7,7 @@
<body>
<script>
/*
const countries = [
'Albania',
'Bolivia',
@ -60,6 +61,8 @@
itCompanies.filter( item => {if( item.split(/o/gi).length - 1 > 1){ console.log(item) }})
itCompanies.splice(0,itCompanies.length)
console.log( itCompanies )
*/
</script>
<script src="./main.js" type="module"></script>
</body>
</html>

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

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