找到对象数组中指定的值
var array = [
{ label: "Custom", value: "0" },
{ label: "Admin", value: "1"}
]
要找到array中value为0的label值
var a = array.find(item => item.value == 0);
var label = a.label;
2024-03-19 13:45:10
找到对象数组中指定的值
var array = [
{ label: "Custom", value: "0" },
{ label: "Admin", value: "1"}
]
要找到array中value为0的label值
var a = array.find(item => item.value == 0);
var label = a.label;