The object in the js array, through one of the properties, gets the other value.

the array is as follows:

                [{
                    "name":"",
                    "value":"400-0456-111"
                },
                {
                    "name":"",
                    "value":"www.baidu.com "
                },
                {
                    "name":"",
                    "value":{
                        "address":"",
                    }
                }]

get the value of value through name= contact information. Instead of traversing all the elements, you can end the traversal by directly returning to value when you find it. At present, it can only be written in for loop. Is there a better way to write it? Thank you

Mar.25,2021

let data =  [{
    "name":"",
    "value":"400-0456-111"
},
{
    "name":"",
    "value":"www.baidu.com "
},
{
    "name":"",
    "value":{
        "address":"",
    }
}];
let result = data.find(ele=>ele.name === '');

like this?

Menu