JavaScriptã®reduceé¢æ°ãã¨ã¦ã便å©ãªã®ã§ãã ãã¨ãã° ã¦ãã¼ã¯ã¯ãããªæã var unique = function(array) { return array.reduce(function(a, b) { if (a.indexOf(b) === -1) { a.push(b); } return a; }, []); }; é¢æ°ã®å¤é¨ã«çµæãæ ¼ç´ããå¤æ°ãä½ããªãã¦ããã®ãè¯ãã§ãã *1 ã¡ã¸ã£ã¼ãªä¾ éè¨ reduceé¢æ°ã¯çµæ§æç¨ã£ã¦ããã話 - ãã¨å³ ã«åè¨ãæ大å¤ãæå°å¤ãå¹³åã®ä¾ãããã¾ãã ã¦ãã¼ã¯ How to get an array of unique values from an array containing duplicates in JavaScript? - Stack Overflow ã«ã¯éè¤é¤å»ã®ä¾ã¯ãããããã¯ãªã¾ããã
{{#tags}}- {{label}}
{{/tags}}