I just read a article about for in
statement: blog.niftysnippets.org/2010/11/myths-and-realities-of-forin.html
and created a little array:
<script>
var stuff, index;
stuff = ['a', 'b', 'c'];
stuff.name = "Foo";
for (index in stuff) {
x = document.getElementById("demo")
x.innerHTML = console.log("stuff[" + index + "] = " + stuff[index])
}
</script>
But it doesn't work. Can someone show me what is wrong with it?