// 判断数组类型
let array = [1, 2]
let obj = {
user_mobile: '189',
user_cardno: '342',
}
array instanceof Array //true
obj instanceof Array //false
array instanceof Object //true
obj instanceof Object //true
array constructor ==Array //true
obj constructor ==Array //false
array constructor ==Object //false
obj constructor ==Object //true
Array.isArray(array) //true
Array.isArray(obj) //false
if (Object.prototype.toString.call(value) == "[object Object]") {
value = JSON.stringify(value);
}
if (Object.prototype.toString.call(value) == "[object Array]") {
value = JSON.stringify(value);
}