Through one property, find another property in the object

there is an array that contains a bunch of objects. The attributes in the object have the value of a label known by label and value,. How to find the value of its corresponding value in the object

for example: the value, in the picture wants to find the corresponding label

Mar.12,2021

filter with filter of the array, see the following example.

var array = [
    {label: '', value: '370000'},
    {label: '', value: '220000'},
    {label: '', value: '430000'}
]
function getValue(label, arr) {
    var filterArray = arr.filter(function(v) {
        return v.label === label
    })
    if (filterArray.length) {
        return filterArray[0].value
    }
}

var value = getValue('', array);
console.log(value)

var array = [
    { label: '', value: '370000' },
    { label: '', value: '220000' },
    { label: '', value: '430000' }
]
const labelToValue = {}
for (let i of array) {
    labelToValue[i.label] = i.value
}

console.log(labelToValue[''])
Menu