Pseudo array
// Objects with length have the length attribute
obj={
"0":"Cai"."1":18.length:2
}
Copy the code
Three ways to convert a pseudo-array to an array
1. [].slice.call(obj) = array.protype.slice.call (obj)
var newArr=[].slice.call(obj)
Copy the code
2.Array.form(obj), new syntax for ES6
var newArr=Array.from(obj)
Copy the code
3. Use extension operators, also ES6 syntax
var newArr= [...obj]
Copy the code