Ad
  • Custom User Avatar

    Not an issue. Depends on the definition and if you allow it (as it's shown here) or not.

  • Custom User Avatar

    I don't think any word should be considered as an anagram for itself. So this example: 'racer' -> ['carer', 'racer'] is looking strange.

  • Custom User Avatar

    if you use assert.strictEqual in your test, do not, it performs shallow check. Use assert.deepEqual instead.

  • Custom User Avatar

    Wrong. Here is the condition:
    flatten('a', ['b', 2], 3, null, [[4], ['c']]) // returns ['a', 'b', 2, 3, null, 4, 'c']

    This solution converts any item to string, so flatten('a', ['b', 2], 3, null, [[4], ['c']]) returns ['a', 'b', '2', '3', '', '4', 'c']