JavaScript - JS
\n/**\n * @param {string[]} words\n * @return {number}\n */\nvar similarPairs = function (words) {\n  let result = 0;\n\n  for (let i = 0; i < words.length; i++
```\n/**\n * @param {string[]} words\n * @return {number}\n */\nvar similarPairs = function (words) {\n  let result = 0;\n\n  for (let i = 0; i < words.length; i++) {\n    for (let j = 0; j < words.length; j++) {\n      let firstWord = [...new Set(words[i])]\n        .sort((a, b) => (a > b ? 1 : -1))\n        .join("");\n      let secondWord = [...new Set(words[j])]\n        .sort((a, b) => (a > b ? 1 : -1))\n        .join("");\n      if (i !== j && firstWord === secondWord) {\n        result++;\n      }\n    }\n  }\n\n  return result / 2;\n};\n```
['JavaScript']