js基础 Array.of

 

 

let cc = new Array(1,2,3);
console.log(cc);
[ 1, 2, 3 ]

 

 

 

var ca = new Array(3);
console.log(ca);
[ <3 empty slots> ]


var arr = Array.of(4);
console.log(arr);
[ 4 ]

 

posted @ 2021-02-26 20:33  AngDH  阅读(48)  评论(0编辑  收藏  举报