forked from Asabeneh/JavaScript-for-Everyone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path16-1.0-array.js
46 lines (45 loc) · 878 Bytes
/
16-1.0-array.js
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
const 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);