progtips

prototypeを使って既存型を拡張

最終更新:

progtips

- view
メンバー限定 登録/ログイン
Number.prototype.pow = function(n)
        {
                return Math.pow(this,n);
        };
Number.prototype.echo = function(n)
        {
                WScript.Echo(this);
        };

Number(500).pow(2).echo();
記事メニュー
ウィキ募集バナー