📖[TypeScript]配列の値の重複を排除する2023/11/28に公開JavaScriptTypeScripttechconst duplicate = [1, 1, 2, 3]; const unique = [...new Set(duplicate)]; console.log(unique); // [1, 2, 3] 参考 https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Operators/Spread_syntax https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Set Discussion
Discussion