ã¾ããprototypeããããã£ãå©ç¨ãã¦ãPoint.moveToã¡ã½ããã¨Point.toStringãå®ç¾©ããæ¹æ³ãç´¹ä»ãã¾ãããã // moveTo ãé¢æ°ã¨ãã¦å®ç¾©ãååã¯ä½ã§ãè¯ããã // Point_ãã¤ãã¦ããã¨åããããã function Point_moveTo(x, y) { this.x = x; // ãããã㣠x ãå¤æ´ this.y = y; // ãããã㣠y ãå¤æ´ return this; // èªåèªèº«ãè¿ãããã«ããã¨ä¾¿å© } function Point_toString() { // toString ãé¢æ°ã¨ãã¦å®ç¾© return "Point(" + this.x + ", " + this.y + ")"; } function Point(x, y) { // ã³ã³ã¹ãã©ã¯ã¿ã§ã¯ã¡ã½ããã¯è¨å®ããªã this.x = x; t
{{#tags}}- {{label}}
{{/tags}}