File tree Expand file tree Collapse file tree 1 file changed +30
-7
lines changed Expand file tree Collapse file tree 1 file changed +30
-7
lines changed Original file line number Diff line number Diff line change 388388 const c = Array . of ( 2 , false , 'test' , { 'name' : 'Alex' } ) ;
389389}
390390
391+ // Array Like
392+ {
393+ const array_like = {
394+ 0 : 'A' ,
395+ 1 : 'B' ,
396+ 2 : 'C' ,
397+ length : 3
398+ }
399+
400+ array_like [ 1 ]
401+
402+ Array . from ( array_like )
403+
404+ document . getElementsByTagName ( 'li' )
391405
392- const array_like = {
393- 0 : 'A' ,
394- 1 : 'B' ,
395- 2 : 'C' ,
396- length : 3
406+ function checkArgs ( ) {
407+ console . log ( arguments . length ) ; // logs 2.
408+ }
397409}
398410
399- array_like [ 1 ]
411+ // Array.from()
412+ {
413+ const collection = Array . from ( document . getElementsByTagName ( 'li' ) )
414+ }
400415
401- Array . from ( array_like )
416+ // Array.fromAsync()
417+ {
418+ Array . fromAsync ( {
419+ length : 3 ,
420+ 0 : Promise . resolve ( 'tapaScript' ) ,
421+ 1 : Promise . resolve ( 'Google' ) ,
422+ 2 : Promise . resolve ( 'Apple' ) ,
423+ } ) . then ( ( array ) => console . log ( array ) ) ;
424+ }
You can’t perform that action at this time.
0 commit comments