-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArrays in js.html
87 lines (49 loc) · 1.77 KB
/
Arrays in js.html
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Arrays</title>
</head>
<body>
<script>
// const Computer_Expert = ["Software-enginer", "Data-Scientist" , "Computer-Scientist" , "Developers" , "Tester" ];
// console.log(Computer_Expert);
// console.log("Computer_Expert[1]= " + Computer_Expert[1]);
// // console.log(Computer_Expert.length);
// Computer_Expert[2]="Data-Analysist";
// for(let q=0;q<Computer_Expert.length;q++) {
// console.log(Computer_Expert[q]);
// }
// console.log(Computer_Expert);
// // console.log(Computer_Expert.indexOf);
// concat() is used for joining two arrays
// const Array1=["Fiver" , "Upwork" , "E-commerce" , "Amazon" , "Linkedin"];
// const Array2=["Freelancing" , "Webdeveloping" , "ReactJS" , "JQuery"];
// const Array3= Array1.concat(Array2);
// console.log(Array3);
// document.write(Array3);
// const phones = ["samsung", "Redmi", "Oneplus", "Iphone"];
// let data = phones.constructor;
// console.log(data);
"use strict";
// Strict mode is declared by adding "use strict"; to the beginning of a script or a function.
// Declared at the beginning of a script, it has global scope (all code in the script will execute in strict mode):
var x=10;
// const phones = [ "Alpha", "samsung", "Redmi", "Oneplus", "Iphone"];
// phones.sort();
// // phones.reverse();
// console.log(phones);
// </script>
<!--
Four types of loops in JS :
1. WHILE LOOP. (NUMBER OF ITERATION IS NOT GIVEN Eg.. ATM ,)
2. DO WHILE LOOP.
3. FOR LOOP (NUMBER OF ITERATION GIVEN).
4.FOREACH LOOP
ARRAYS IN JS
1. SIMPLE ARRAY.
2. ASSOCIATIVE ARRAY \ OBJECT. -->
</body>
</html>