Created
December 2, 2013 15:38
-
-
Save regepan/7751307 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Rectangle(w, h){ | |
this.width = w; | |
this.height = h; | |
} | |
Rectangle.prototype.area = function(){ | |
return this.width * this.height; | |
} | |
var r = new Rectangle(); | |
/** | |
* プロパティを調べる | |
*/ | |
// 動かない | |
for(key in Rectangle){ | |
console.debug(key + ':' + Rectangle[key]); | |
} | |
// 動く | |
for(key in r){ | |
console.debug(key + ':' + r[key]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment