找到对象数组中指定的值
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;
原文地址:https://www.cnblogs.com/rong88/p/11351545.html
时间: 2024-10-07 01:42:42