JS将对象转换为数组 //将对象转换为数组 function ToArray(obj) { var arr = []; //定义数组 arr.push(obj); console.log(arr); return arr; }