Skip to content

Commit 1fc6e0e

Browse files
authored
Update index.js
1 parent 8279bf0 commit 1fc6e0e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

index.js

+28
Original file line numberDiff line numberDiff line change
@@ -371,3 +371,31 @@
371371
anotherArray.at(-2); // 8
372372
}
373373

374+
// The isArray() method
375+
{
376+
const arr = [1,2,3,4];
377+
Array.isArray(arr);
378+
Array.isArray({});
379+
Array.isArray(1);
380+
Array.isArray([]);
381+
}
382+
383+
384+
// The Array.of() method
385+
{
386+
const a = new Array(2,3,4);
387+
const b = [4,5,6];
388+
const c = Array.of(2, false, 'test', {'name': 'Alex'});
389+
}
390+
391+
392+
const array_like = {
393+
0: 'A',
394+
1: 'B',
395+
2: 'C',
396+
length : 3
397+
}
398+
399+
array_like[1]
400+
401+
Array.from(array_like)

0 commit comments

Comments
 (0)