one-linear solution (Object.values, filter, map, reduce)
Code\n\n/**\n * @param {string[]} words\n * @return {number}\n */\nvar similarPairs = function(words) {\n    return Object.values(\n            words\n         
# Code\n```\n/**\n * @param {string[]} words\n * @return {number}\n */\nvar similarPairs = function(words) {\n    return Object.values(\n            words\n                .map(str => Array.from(new Set(str)).sort().join(\'\'))\n                .reduce((acc, str) => {\n                    acc[str] = (acc[str] ?? 0) + 1;\n                    return acc;\n                }, {}),\n        )\n        .filter(count => count > 1)\n        .map(count => count / 2 * (count - 1))\n        .reduce((acc, pairs) => acc + pairs, 0);\n};\n\n```
['JavaScript']