9
var shell = function (method) {
        window[method].apply(null, Array.prototype.slice.call(arguments, 1));
    };

shell('alert', 'monkey!');
4

1 に答える 1

10

alert.applyが問題です。アラートは言語の一部ではないため、関数でさえない場合があります。これは実装依存です。

于 2010-07-06T12:46:00.640 に答える