Q:

decodeURIComponent not working

I have the following code:

var msg = "Research &amp; Analysis",
    decoder = decodeURIComponent(msg);

console.log(msg);
console.log(decoder);

Can someone please help me understand why the decodeURIComponent(msg); is not actually decoding the &amp; in the string? 
I am expecting it to return something like Research & Analysis instead of Research &amp; Analysis

A:

decodeURIComponent decodes, well, URI components, meaning URL-encoded strings. & amp; is an HTML entity, not URL-encoding.  decodeURIComponent has nothing to do with HTML encoding.