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?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3953f-2c17f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3953f-2c17f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?