I've tried the following code and was surprised to discover that for var in object returns also objects methods. I'm not sure why does it happen, are object methods essentially properties? Is there any way to make it return only properties containing values?
var object = {p1: 1, p2: 2, p3: 3};
object.funkcja = function() {
for (var x in object) {document.getElementById("test").innerHTML += object[x] + "<BR>";}
};
example: