javascript

PHOTO EMBED

Fri Apr 28 2023 06:39:29 GMT+0000 (Coordinated Universal Time)

Saved by @Himanshu007 #javascript

var object = {
  "main": [{
    "id": "123",
    "name": "name 1"
  }, {
    "id": "234",
    "name": "name 2"
  }]
};
var toFind = "name 1";
var filtered = object.main.filter(function(el) {
  return el.name === toFind;
});

document.write(filtered);
content_copyCOPY

that is used for the finding the data from the object of array , and match the given input from the data.