Typescript solution. 2 different ways
This first solution has a problem trying to parse &amp;gt; so I had to handle this case separately.\n\nfunction entityParser(text: string): string {\n    \n    
This first solution has a problem trying to parse **&amp;amp;gt;** so I had to handle this case separately.\n```\nfunction entityParser(text: string): string {\n    \n    return (text === \'&amp;gt;\') ? \'&gt;\' : text.replace(/&quot;/g, \'"\').replace(/&apos;/g, "\'").replace(/&amp;/g, \'&\').replace(/&gt;/g, \'>\').replace(/&lt;/g, \'<\').replace(/&frasl;/g, \'/\');\n\n};\n```\n\nUsing map\n```\nfunction entityParser(text: string): string {\n    \n    const parser = {\n        \'&quot;\' : \'"\',\n        \'&apos;\' : "\'",\n        \'&amp;\'  : \'&\',\n        \'&gt;\'   : \'>\',\n        \'&lt;\'   : \'<\',\n        \'&frasl;\':\'/\'\n    }\n    \n    return text.replace(/&amp;|&quot;|&apos;|&gt;|&lt;|&frasl;/g, (t) => {\n        return parser[t];\n    });\n};\n```
['TypeScript', 'JavaScript']