filtering json array in javascript

const data = [
  {
    name: 'Bob',
    gender: 'male',
    age: 34,
  },
  {
    name: 'Carol',
    gender: 'female',
    age: 36,
  },
  {
    name: 'Ted',
    gender: 'male',
    age: 38,
  },
  {
    name: 'Alice',
    gender: 'female',
    age: 40,
  },
];

const arr1 = data.filter(d => d.age > 37);
console.log('arr1', arr1);

const arr2 = data.filter(d => d.gender === 'female');
console.log('arr2', arr2);

const ageAndGender = d => d.age > 37 && d.gender === 'female';

const arr3 = data.filter(ageAndGender);
console.log('arr3', arr3);

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
.filter json array json filter example javascript filtering JSON based on values in array filter json from a array how to filter JSON from array how to filter JSON from array of values how to filter object of array json data how to filter json array filter array json javascript json filter by value javascript array of json filter filter the json in js filter json and make array js javascript filter json array FILTER using json in array javascript javascript filter json object and return json filter by json json filter by filter json js filter json object filter value from json array javascript filter in json object javascript filter data from json array in javascript filter json object from object array javascript filter an object array from json how to filter a json array array of object json filter filter in json javascript filter data from json filter json js filter json data in javascript with array filtering json data how to filter json by a field array filter a json array filter json with array filter json data in javascript filter on json js javascript filter json array javascript search and filter json array filter jsonarray how to filter json file and get an array filter data in json js filter json array json array filter javascript array filter json object javascript filter array json json object filter in javascript filtering data json javascript json filter array.filter json files in javascript filter from json in javascript json filter from json array filter in nodejs json filtering exjs how to filter json data in javascript how to filter json into array in node js json array filter in javascript filter in json array javascript javascript filter JSON javascript how to filter json array create array javascript filtering field json filter data from json object in javascript how to filter my json file how to filter json file data node js filter json array filter json object how to filter json array in javascript filter json object javascript filter function for json array js filter javascript array of json json array filter javascript json array filter by value filter json in javascript filter array in json filter JSON item js filter a json array javascript filter on json js filter in array of json filter inside json object array filter in json array how to filter json object array in javascript filter json filter json data in array using node filtering json filtering json array in javascript quering and filtering json array and json object mongoose js filter object attr is not in filtering json javascript how to filter an array of objects by a value in the field of an object filter array json javascript how to filter a value from an array of object in javascript filtering json array with javascript how to filter strings in javascript object filter json array on string javascript json array filter SPECIFIC COLUMN javascript filter json with array javascript how to filter array of object json filter array filter an array of objects according to a custom object in js how to filter object in array of object in javascript filter an array of json javascript filter array of objects by value How to filter a array of objects filter object from json array javascript filter object by property value filter json object array in javascript filter arrays having same property in javascript javascript array json filter filter array of object for Each array object how to filter object on the basis of its attribute filter out an object from an array of object in javascript javascript how to filter object in object array json filter example javascript filter array of object by value filter javascript object by value how to filter objects in array filter object property that are not in both arrays javascript javascript filter object by value how to filter values in object and put it in a array js filter object from array filter object of array javascript javascript filter objects in array js filter object by value array filter a object js array filter a object js filter array of objects array filter json js filter array by object field filter object array javascript filter object javascript array filter array of objects by property js javascript filter array of objects by property filter json object array javascript filter array of objects filter object of array javascript specific value javascript filter object based on its value apply filter on json array javascript javascript filter object of arrays js filter object value base on certain string json object filter filter json object js JSON Array.prototype.filter() create table filters json object javascript javascript object array filter by certain property in array javascript filter in array of objects javascript filter json array by value json filter javascript filter json file javascript filter value in array of object an array javascript filter array of objects javascript filter json array in javascript filter object array and return one parameter how to filter the object based on array in javascript how to use filter on json object how todo filtering on json filter equal to object javascript how to filter array of objects in javascript filter json data javascript how to filter a json array in javascript filter obj json js javascript array of objects filter js json filter how to filter data in json json filter json objet filtering filter json array json javascript filter array of objects filter filter json array javascript filter json javascript filter array javascript filter json object parameter js online js filter method js filter array of objects by value filter from array javascript access array in json appscript
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source