Javascript | Hashmap | with comments
\n// Extracting only unique food and storing it as hash map with null \nvar displayTable = function(orders) {\n    let onlyFoods = orders.reduce((acc, val)=>{\n
```\n// Extracting only unique food and storing it as hash map with null \nvar displayTable = function(orders) {\n    let onlyFoods = orders.reduce((acc, val)=>{\n       acc[val[2]] = null;\n        return acc;\n    },{})   \n\n\n// Kept all the keys, sorted it and added \'Table\' in 0th index\n    let tableMenu = Object.keys(onlyFoods);\n    tableMenu.sort();\n    tableMenu.unshift(\'Table\');\n\n    let len = orders.length;\n    let tableMenulen = tableMenu.length;\n    let forTables = [tableMenu];\n    \n\t// It\'s time to create a final hash map that is going to contain table number and all food with count\n    let allinone = orders.reduce((acc, val)=>{\n        if(acc[val[1]] == undefined)  acc[val[1]] = {};\n       if(acc[val[1]][val[2]] == undefined) acc[val[1]][val[2]] = 0;\n       acc[val[1]][val[2]]++;   \n        return acc;\n    }, {});   \n\n// Utilising my hashmap in order to create required table\n    for(let i in allinone){\n        let b = [i];\n        for(let j=1; j<tableMenu.length;j++){\n            b.push(allinone[i][tableMenu[j]]?allinone[i][tableMenu[j]].toString(): "0");\n        }\n        forTables.push(b);\n    }\n\n    return forTables;\n \n};\n```
['Hash Table', 'JavaScript']