Js array traversal

var obj = [
{"id":" 152", "name":" file test"},
{"id":" 23", "name":" file test"},
{"id":" 23", "name":" file test"};
]
how to traverse the value of id to form an array
to get an array

Mar.16,2022

var newArr=[];
for(var i=0; i<obj.length; iPP){
    if(obj[i].id) newArr.push(obj[i].id);
}
console.log(newArr)

the oldest way to write


map was

 obj.map(v=>v.id);
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-1e497d4-43a64.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-1e497d4-43a64.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?