- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path08_arrays.js
More file actions
Latest commit
28 lines (23 loc) · 715 Bytes
/
Copy path08_arrays.js
File metadata and controls
28 lines (23 loc) · 715 Bytes
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
// Arrays , Functions and objects
// Arrays - [] , 0 index based
// here is not efisien if declare multiple variable
constfriend1='anna';
constfriend2='anna';
constfriend3='anna';
constfriend4='anna';
// ........100 friend
// so for effective use array
// remember for string should be '' if not , not defined
constfriend=['anna','john','peter','kelly',50,'jane'];
// for print all obj on array friend
console.log(friend);
// for knowing total array
console.log(friend.length);
// for access john
console.log(friend[1]);
// or for best u can declare variable
constbestFriend=friend[0];
console.log(bestFriend);
// for re-assign 50 be string
friend[4]='dncode';
console.log(friend[4]);