引言:ES6提供了一些对数组的操作,记此笔记
开始学习
1.json转数组 (Array.from)
let json = {
'0':'a',
'1':'b',
'2':'c',
'3':'d',
length:4
}
console.log(Array.from(json ))
2.数组循环(for of)
只取值
let arr = ['c++','c语言','java','python'];
for(let val of arr){
console.log(val);
}
只取下标