JavaScript Solution
\n# Code\n\n/**\n * @param {string[]} words\n * @return {number}\n */\nvar similarPairs = function(words) {\n  let count = 0;\n  for (let i = 0; i < words.lengt
\n# Code\n```\n/**\n * @param {string[]} words\n * @return {number}\n */\nvar similarPairs = function(words) {\n  let count = 0;\n  for (let i = 0; i < words.length; i++) {\n    for (let j = i + 1; j < words.length; j++) {\n      if (sameCharacters(words[i], words[j]) && i !== j) {\n        count++;\n      }\n    }\n  }\n\n  return count;\n};\n\nconst sameCharacters = function (wordOne, wordTwo) {\n  const set1 = new Set(wordOne);\n  const set2 = new Set(wordTwo);\n  if (set1.size !== set2.size) {\n    return false;\n  }\n\n  return [...set1].every((i) => set2.has(i));\n};\n```
['JavaScript']