Why do I need an else statement to check for keys in an object in Javascript?
I'm doing Leetcode Question Number 49.. I entered this but it did not work. var groupAnagrams = function(strs) { if (strs.length <= 1) { return [strs] } const hashMap = {} for(let i = 0; i < strs.length; i++) {…