JavaScript Solution - Two Pointers Approach
\nvar entityParser = function(text) {\n    const n = text.length;\n    const ent = {\n        "&quot;": \'"\',\n        "&apos;": "\'",\n        "&amp;": "&",\n
```\nvar entityParser = function(text) {\n    const n = text.length;\n    const ent = {\n        "&quot;": \'"\',\n        "&apos;": "\'",\n        "&amp;": "&",\n        "&gt;": ">",\n        "&lt;": "<",\n        "&frasl;": "/"\n    };\n    \n    let res = "";\n    let start = 0;\n    \n    while (start < n) {\n        const startChar = text.charAt(start);\n        \n        if (startChar != "&") {\n            res += startChar;\n            start++;\n            continue;\n        }\n        \n        let str = "&";\n        let end = start + 1;\n        \n        while (end < n) {\n            const endChar = text.charAt(end);\n            \n            if (endChar === ";") {\n                str += endChar;\n                \n                res += ent[str] ?? str;\n                \n                str = "";\n                end++;\n                break;\n            }\n            else if (endChar === "&") {\n                res += str;\n                str = "";\n                break;\n            }\n            else {\n                str += endChar;\n                end++;\n            }\n        }\n        \n        res += str;\n        start = end;\n    }\n    \n    return res;\n};\n```
['Two Pointers', 'JavaScript']