884 | JavaScript 1-Line Solution
Here\'s an unconventional solution the likes of which I didn\'t see any other instances.\n\n> Runtime: 72 ms, faster than 78.46% of JavaScript online submission
Here\'s an unconventional solution the likes of which I didn\'t see any other instances.\n\n> Runtime: **72 ms**, faster than *78.46%* of JavaScript online submissions\n> Memory Usage: **38.4 MB**, less than *5.15%* of JavaScript online submissions\n\n```javascript\nconst uncommonFromSentences = (a, b) =>\n  `${a} ${b}`\n    .split(\' \')\n    .filter(\n      word =>\n        0 ===\n        ` ${a} ${b} `.indexOf(` ${word} `) -\n          ` ${a} ${b} `.lastIndexOf(` ${word} `),\n    );\n```\n\nAnd here is a boring less outside-of-the-box solution.\n\n> Runtime: **64 ms**, faster than *96.78%* of JavaScript online submissions\n> Memory Usage: **37.2 MB**, less than *11.58%* of JavaScript online submissions\n\n```javascript\n/**\n * @param {string} a\n * @param {string} b\n * @return {string[]}\n */\nconst uncommonFromSentences = (a, b) =>\n  [\n    ...`${a} ${b}`\n      .split(\' \')\n      .reduce(\n        (map, word) => map.set(word, (map.get(word) || 0) + 1),\n        new Map(),\n      ),\n  ].reduce((acc, [word, cnt]) => {\n    if (1 === cnt) acc.push(word);\n    return acc;\n  }, []);\n```
['String', 'JavaScript']