-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJsArray.js
52 lines (41 loc) · 856 Bytes
/
JsArray.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
47
48
49
50
function myFunction(){
const cars=['bmw','rolls roys ','audy'];
return cars;
}
function myFunction1(){
const cars=[
'bmw',
'rolls roys ',
'audy'
];
return cars;
}
function myFunction2(){
const cars=[];
cars[0]='bmw';
cars[1]='rolls roys ';
cars[2]='audy';
return cars;
}
function myFunction3(){
const cars = new Array("Saab", "Volvo", "BMW");
return cars;
}
function myFunction4(){
const cars = new Array("Saab", "Volvo", "BMW");
let x=cars[0];
return x;
}
function myFunction5(){
const cars = new Array("Saab", "Volvo", "BMW");
cars[0]='rolls roys';
return cars;
}
function myFunction6(){
const cars = new Array("Saab", "Volvo", "BMW");
return cars[0];
}
function myFunction6(){
const person = {firstName:"John", lastName:"Doe", age:46};
return person.firstName;
}