LoginSignup
0

More than 1 year has passed since last update.

Unique Array By Key 【JavaScript】

Last updated at Posted at 2022-06-28
const uniqArr = (arr, key) => {
    return [
        ...new Map(arr.map(item => [item[key], item])).values()
    ]
};

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0