Is filter suitable for this scenario? It's still map?.

let obj= [
// 
    {
      name: "shoes",
      data: [
        {
          value: [1, 2]
        }
      ]
    },
// 
    {
      name: "shoes2",
      data: [
        {
          value: [2, null]
        }
      ]
    }
  ];
 
 [
    {
      name: "shoes",
      data: [
        {
          value: [1, 2]
        }
      ]
    }
  ]
  //valuenull
  ~
  
  obg.filter(item=>{
    return item.data.filter(v=>{
      return v.value[1]!==null
    })
  })
  console.log(obj) //
Sep.16,2021

your logic fault is that the filter function returns a new array. In filter, it returns a Boolean value, but you return the array returned by filter as if it were true or false.

let obj= [
// 
    {
      name: "shoes",
      data: [
        {
          value: [1, 2]
        }
      ]
    },
// 
    {
      name: "shoes2",
      data: [
        {
          value: [2, null]
        }
      ]
    },

  ];



  var ss =   obj.filter(item=>{
      return item.data[0].value[1]!==null
  });

  console.log(ss);

the above code meets your requirements. If you are similar to the following structure, as long as one of them is null, then the code logic is:

        
let obj= [
// 
    {
      name: "shoes",
      data: [
        {
          value: [1, 2]
        }
      ]
    },
// 
    {
      name: "shoes2",
      data: [
        {
          value: [2, null]
        }
      ]
    },
    // 
    {
        name: "shoes3",
        data: [
            {
            value: [3, 4]
            },
            {
            value: [3, null]
            }        
        ]
    },
     // 
     {
        name: "shoes4",
        data: [
            {
            value: [4, 4]
            },
            {
            value: [4, 4]
            },
            {
            value: [4, 4]
            }            
        ]
    }         
  ];


  var ss =   obj.filter(item=>{
      if(item.data.some((v,index,arr)=>{
          return v.value[1] === null
      }))
      {
          return false;  
      }else{
          return true;
      }
  });

  console.log(ss);


you don't need filter to get attribute values directly inside

.
let arr = obj.filter(item => {
  return !!item.data.value[1]
})
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-1b3ba49-412ef.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-1b3ba49-412ef.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?