问:Array.from()基本用法
七娃博客
341人阅读
Array.from() 方法对一个类似数组或可迭代对象创建一个新的,浅拷贝的数组实例,把字符串或类似数组转成数组。
Array.from('hello'); //['h','e','l','l','o'] //或者 const items=new Set([1,2,3,4]) const array=Array.from(items) //[1,2,3,4]
主题开源不易,支持一下作者吧!
使用支付宝打赏
使用微信打赏
评论 | 0 条评论
登录之后才可留言,前往登录