javascript - For var in object returns methods together with properties -


I have tried the following code and am surprised to know that Object Returns for Verdes in the ORIID also objects I'm not sure Why does this happen, do objects are essentially properties? Does there a quality in it that it returns only properties with properties?

  var object = {p1: 1, p2: 2, p3: 3}; Object.funkcja = function () {for (var x in object) {document.getElementById ("test"). Internal HTML + = Object [x] + "& lt; BR & gt;";}};  

Example:

I think this is the right way : (Object isOwnProperty (x) & amp; (function [x] function for example) {document.getElementById ("test")

  internal HTML + = object ] + "& Lt; BR & gt;"; }}  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -