js return unique values from array of objects

const array = [    { id: 3, name: 'Central Microscopy', fiscalYear: 2018 },    { id: 5, name: 'Crystallography Facility', fiscalYear: 2018 },    { id: 3, name: 'Central Microscopy', fiscalYear: 2017 },    { id: 5, name: 'Crystallography Facility', fiscalYear: 2017 }  ];const result = [];const map = new Map();for (const item of array) {    if(!map.has(item.id)){        map.set(item.id, true);    // set any value to Map        result.push({            id: item.id,            name: item.name        });    }}console.log(result)

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
get unique values from an object javascript unique array with object get all unique values from array of objects javascript get all the unique values in object array unique objects in array javascript js map object by unique value how to get unique from objects of arrays in javascript by taking two values javascript find unique values in array of objects js unique objects in array Javascript distinct values in object array array object unique how to make unique id array of object find unique elements in array of objects javascript JS how get unique fields from array of ojects get unique values from object javascript javascript get unique keys from array of objects javascript unique array of objects by property javascript get unique keys of object how to pass unique object in array in javascript js object array get unique objects unique values from array of objects javascript get unique values in array of objects based on id how to find unique values from array of object and store it in different array in js javascript get all unique values from object array find unique objects in array javascript map array of objects get unique values objects javscript get unique values from array of objects filter unique values in array of objects javascript how to get unique array of objects in javascript unique object array javascript count unique objects in array javascript how to map a javascript object and get all unique object with key how to map a javascript object and get all unique object js get unique values from array of objec get unique values from array of object js javascript get unique values from array of object js get unique values from array of object get unique values from array of object javacript js get unique values from array of objects get unique values from array of objects javacript javascript get unique values from array of objects java script get unique values from array of objects get unique values from array of objects javascript javascript unique array of objects hot to get unique object array javascript to get unique values from object get all unique values for property in array of objects javascript javascript unique object unique array of objects
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