Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9ec80f

Browse files
committed
partTwoArray done
1 parent 2c2982e commit c9ec80f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

02_basics/partTwoArray.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
console.log("hello world");
2+
const friends = ["waseem", "fahad", "Talha"];
3+
const anotherFriends = ["abdulrehman", "shams", "abdul-hadi"];
4+
//friends.push(anotherFriends);
5+
console.log(friends);
6+
//console.log(friends[3][1]);
7+
const allfriends = friends.concat(anotherFriends);
8+
console.log(allfriends);
9+
console.log(typeof allfriends); // object
10+
11+
const all_other_friends = [...friends, ...anotherFriends];
12+
console.log(all_other_friends);
13+
14+
const randomArray = [1, 2, 3, [4, 5, 6], 7, 8, 9, [10, 11, 12]];
15+
randomArray.flat(Infinity);
16+
console.log(randomArray);
17+
18+
// const obj ={};
19+
// obj.length=8;
20+
// console.log(obj.length); //8 answer

0 commit comments

Comments
 (0)