As the MDN website says "for...in is most practically used for debugging purposes", which I also am doing. Is there any other way to get the same results instead of using for ... in
to get an array of the keys?
Every other thread on stackoverflow I read about it gave alternatives like in the code below, that are not a solution for getting the same functionality.
var myp= document.createElement('p');
var a = new Array();
for (var each in myp) { a.push(each);}
var b = Object.keys(myp);
var c = Object.getOwnPropertyNames(myp);
console.log(a,b,c);
Edit: The "duplicate" given as closing reason has a totally other question's purpose, and unsurprisingly their isn't an answer to my question on that duplicate thread either. :/