Vik*_*ram 0 javascript google-chrome internet-explorer-8
考虑在IE8和Chrome控制台中运行以下代码进行比较:
var a = function(){ console.log("function is() initialized"); };
// assign a property named 'function' to function 'a'
a.function = function afunction(f){ return (typeof f === 'function'? true: false); };
// Use our is function to test if a given variable is a function
a.function(a); // IE throws 'expected identifier' error v/s Chrome correctly outputs "true"
Run Code Online (Sandbox Code Playgroud)
任何想法如何在IE8中解决这个问题而不改变函数签名:a.function()?
| 归档时间: |
|
| 查看次数: |
61 次 |
| 最近记录: |