Last active
July 14, 2017 09:55
-
-
Save mailzwj/77108655bdd1b15c937490655f9be524 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
相信许多前端开发者都知道,Javascript在前端开发中必不可少,但是在Javascript中有很多不兼容的方法,通常我们直接使用会带来一些麻烦。 | |
因此需要自己动手写一些替代(兼容)方案。 | |
来说一说大家都遇到哪些不兼容的方法,又是如何去实现兼容的吧。 | |
示例: | |
Array.isArray = Array.isArray || function(array) { | |
return Object.prototype.toString.call(array) === '[object Array]'; | |
}; | |
Author
mailzwj
commented
Jul 14, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment