Js array to object

var a = [
"dwadmin",
"rladmin",
"ypadmin",
"ocradmin",
"admin",
"cvadmin"
]
to
var b = [
{"value": "dwadmin"},
{"value": "rladmin"},
{"value": "ocradmin"},
{"value": "admin"},
{"value": "cvadmin"},
{"value": dwadmin "},
];

May.30,2022

var res = a.map(item => {
  return {value: item}
})

is there anyone rushing to answer this question? Shouldn't you step on it?


var b = []
a.forEach((v, i) => {
    b.push({
        value: v
    })
})

  var obj=[]
  for(var i=0;i<a.length;iPP){
    obj.push({
      "value":a[i]
    })
  }

a.map(v=>({value:v}))
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-1ea96ef-1f5b.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-1ea96ef-1f5b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?