ij.Log

code

var json= [
  {
    "id": "1",
    "avaiable": true,
  },
  {
    "id": "2",
    "avaiable": false,
  },
  {
    "id": "3",
    "avaiable": false,
  }
];

var result = json.filter(value => value.avaiable === true);
console.log(result);

/*
[ { id: '1', avaiable: true } ]
*/

블로그 구현에 사용했던 코드

  const posts = edges.filter(({node}) => {
    const tags = node.frontmatter.tags.map(tag =>{return tag.toLowerCase();});
    if(tags.includes(tag)){
      return(node)
    }
  });