New course! Every coder should learn Generative AI!
Try a free lesson+ 3
this is a simple document inspector
for(k in document){
p.innerHTML += "."+k+"<br/>";
p.innerHTML += document[k]+"<br/>";
}
if you are inspecting an object, the instanceof let you find out if the parts of the object are functions, other objects, or parameters.
obj could be: window, or document, or any tag
for(k in obj){
if(obj[k] instanceof Function){
p.innerHTML += "Function<br/>";
p.innerHTML += "Parameters: "+obj[k].length+"<br/>";
p.innerHTML += "."+k+"()<br/><br/>";
}
}
in this example it was important to my to find out how many parameters a function needs