この質問の回答は、これを使用して関数が定義されているかどうかを確認することを示しています。
typeof yourFunction === 'function'
しかし、私はこれを非標準の関数link()で試しました。そして実際にはこれはfalseを返しました。この機能は、私が試したすべてのブラウザ(IE、Chrome、Opera、FireFox)で利用できます。
typeof String.link === 'function' // false
typeof String.link() === 'function' // Uncaught error ...
それからどこかで私は見つけます:
typeof String.prototype.link === 'function' //true
これは実際にはtrueを返します。違いは何ですか?最初のものが失敗する理由は何ですか?