object.hasOwnProperty()判断object属性是否存在。 如一个object如下:- <code> myDog = { "name":"Labby", "tail":1, "color":"black" } myDog.hasOwnProperty("name")//true myDog.hasOwnProperty("friends")//false </code>
Just want to spend this life happier.
Just want to spend this life happier.