๐Ÿ“ฆ Asabeneh / JavaScript-for-Everyone

๐Ÿ“„ 16-1.0-array.js ยท 47 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47const webTechs = [
  'HTML',
  'CSS',
  'JavaScript',
  'React',
  'Redux',
  'Node',
  'MongoDB'
]; // String arrays
const countries = [
  'Albania',
  'Bolivia',
  'Canada',
  'Denmark',
  'Ethiopia',
  'Finland',
  'Germany',
  'Hungary'
]; // string arrays
const numbers = [0, 3.14, 9.81, 37, 98.6, 100]; // Number arrays
const shoppingCart = [
  'Milk',
  'Mango',
  'Tomato',
  'Potato',
  'Avocado',
  'Meat',
  'Eggs',
  'Sugar'
]; // string arrays

const mixedArrays = [
  'Asabeneh',
  250,
  true,
  { country: 'Finland' },
  { skills: ['HTML', 'CSS', 'JavaScript'] }
];
console.log(webTechs);
console.log(webTechs.length); // => to know the size of the array, which is 7
console.log(webTechs[0]); //--> HTML;
console.log(webTechs[webTechs.length - 1]); //--> MongoDB
console.log(countries);
console.log(numbers);
console.log(shoppingCart);
console.log(mixedArrays);