This is not a question about the test itself, but it is related. How can I log an object congaing HTML as plain text?
if the object is ‘&’ , I want to display ‘&’ instead of &
similar to how alert displays … (view as raw)
alert(Object.entries(htmlKVP))
&,&,<,<,>,>,",",’,’
This is my code…
var htmlKVP={
‘&’: ‘&’, ‘<’:’<’, ‘>’:’>’, ‘"’:’"’, ‘’’:"’"
};
console.log(Object.entries(htmlKVP));
this is what the console displays…
&,&,<,<,>,>,",",’,’
this is what I want to display…
&, &, < <, > >, ", ", ', ’