Skip to content

Commit 640cda3

Browse files
authored
Create Array.js
1 parent 9309505 commit 640cda3

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Array.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
//Array
3+
4+
const friend1 = ' Michael';
5+
const friend2 = 'Steven';
6+
const friend3 = 'Peter';
7+
8+
const friend =['Michael','Steven','Peter'];
9+
console.log(friend);
10+
11+
const years = new Array(1991,1984,1932,1972);
12+
13+
console.log(friend[0]);
14+
console.log(friend.length);
15+
console.log(friend.length-1);
16+
17+
friend[2] ='Jay';
18+
19+
console.log(friend);
20+
21+
const rejwar = ['md','rejwar'];
22+
console.log(rejwar);
23+
24+
//
25+
'use strict'
26+
const calcAge = function(birthYear)
27+
{
28+
return 2037-birthYear;
29+
}
30+
31+
const years =[1990,1991,1992,1993];
32+
33+
console.log(calcAge(years));

0 commit comments

Comments
 (0)