Javascript hasOwnProperty 方法 & in 关键字
????
- ????
- ????
-
????function?Test(){
-
????????this.?a=?'abc';
- ????}
-
????Test.prototype.b='efg';
-
-
????var?test=new?Test;
-
????alert(test.hasOwnProperty('a'));
-
????alert(test.hasOwnProperty('b'));
-
-
????alert('a'?in?test);
-
????alert('b'?in?test);