-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SeaJS v1.2 中文注释版 #305
Comments
感谢 @pigcan ! 已加入到文档页中 http://seajs.org/docs/#articles |
源码前面用分号打头,有什么特别的意思吗? 一般每一段js后面不都是加; 号的吗? 为什么上面代码要加在前面呢? |
分号的问题,可以看这篇文章: http://www.zhihu.com/question/20298345 2012/10/16 alan-hjkl [email protected]
王保平 / 玉伯(射雕) |
避免多个文件压缩合并之后本代码出现bug,因为上一个文件会跟这一个文件的内容连起来,没有了换行符,所以很可能出现意料之外的事情 On Oct 16, 2012, at 1:43 PM, alan-hjkl wrote:
|
谢谢二位的回答,这种无分号,或是少分号的方式,代码看起来简洁多啦。 |
util.forEach 自定义实现的方法有点不明白, 网上查阅资料显示这是js 1.6的新特性,是让数组中的每一个元素都执行fn方法。。 照此推的话,那么数组中每一元素都应该是函数名了。执行的方法应该是arr[i].fn( ) 啦 为什么上面的例子中 用 fn(arr[i], i, arr) 呢? |
不是的,arr[i] 是普通数组元素,不一定是函数 2012/10/18 alan-hjkl [email protected]
王保平 / 玉伯(射雕) |
Mark |
mark |
3 similar comments
mark |
mark |
mark |
mark |
util.isObject 为什么不用 toString.call(val) === '[object object]' 而是使用 val === Object(val) 是有什么别的考虑嘛?? |
确实不错 |
JavaScript中基本类型有: null, undefined, number, string, boolean; 引用类型有: Object对象(又叫做plain object),Array数组,Date日期对象,Function函数,以及任意自己构造的自定义class类型。 我们知道:
@berwin 我认为这里isObject函数是用作 |
这里 util.unique数组去重写法也有点问题。这种算法会导致去重后 结果数组中的元素全部变成 |
The text was updated successfully, but these errors were encountered: