How to extract the data needed in array B according to the integer array A?

for example. Integer array A:

[0,2,3]

Array B:

[
  {id:22, name:"aaa"},
  {id:1, name:"sss"},
  {id:2, name:"qq"},
  {id:5, name:"sdd"},
  ...
]

according to array A, the required data is id of [0], [2], [3] bits of array B. It"s [22pr 2pr 5] like this. Could you tell me how to extract it?

Mar.17,2021

let indexs = [0, 2, 3]
let data = [{...}, {...}]
let result = indexs.map(i => data[i].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-1e51427-44958.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-1e51427-44958.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?