Skip to content

Commit ccc40b8

Browse files
[ADD] add collection
1 parent 77b6666 commit ccc40b8

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

ECMAScript/A05-Collection/array.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
let array1=new Array(3);
2+
console.log("size of array1: "+array1.length);
3+
4+
let array2=[1, 2, 3, 4, 5];
5+
for(let i=0;i<5;i++){
6+
console.log("i: "+i);
7+
}

ECMAScript/A05-Collection/map.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
let map1=new Map();
2+
map1.set(1, "value1");
3+
map1.set(2, "value2");
4+
for(let i=1;i<=map1.size;i++){
5+
console.log(map1.get(i));
6+
}

ECMAScript/A05-Collection/set.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
let set1 = new Set(["value1", "value2", "value3"]);
2+
console.log(set1.size);

0 commit comments

Comments
 (0)