On the manipulation of objects in javascript

https://jsfiddle.net/20170808.

how can I output the following format:
/ / Wang Junkai Wang Yuan Yi Qianxi
/ / Jolin Tsai
/ / Gillian sa

var data = [
{
  singer: [
    {name: "",age: 18}, 
    {name: "",age: 20}, 
    {name: "",age: 18}]}, 
{
  singer: [{name: "",age: 33}]}, 
{
  singer: [
    {name: "",age: 31},
    {name: "Sa",age: 30}]
}]

data.forEach((item) => {
  item.singer.forEach(v=>{
    console.log(v.name)
  })
});

//
//
//
//
//
//Sa

()
//  
//
// Sa
Mar.07,2021

var data = [
{
  singer: [
    {name: '',age: 18}, 
    {name: '',age: 20}, 
    {name: '',age: 18}]}, 
{
  singer: [{name: '',age: 33}]}, 
{
  singer: [
    {name: '',age: 31},
    {name: 'Sa',age: 30}]
}];
for(let i=0; i<data.length; iPP){
    let arr = [];
    data[i].singer.map((item)=>{
        arr.push(item.name);
    })
    console.log(arr.join(' '))
}

copy it to the console and try it.


data.forEach( (dataItem,index)=>{
      var str = ''
      dataItem.singer.forEach( (singerItem,index)=>{
        str += (singerItem.name + ',')
      })
      console.log(str.slice(0,str.length-1) )
        
})

data.forEach(o=>{
    var name = o.singer.map(a=>a.name).join(" ")
    console.log(name)
})

use babel to transfer

if compatible.
var data = [
    {
      singer: [
            {name: '',age: 18}, 
            {name: '',age: 20}, 
            {name: '',age: 18}
        ]
    }, 
    {
      singer: [{name: '',age: 33}]
    }, 
    {
      singer: [
        {name: '',age: 31},
        {name: 'Sa',age: 30}]
    }
]

data.forEach(obj => {
    console.log(obj.singer.map(item => item.name).join(" "));
})
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-1e3c8e0-4bdce.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-1e3c8e0-4bdce.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?