datavjs/doc/note.md
2012-10-14 14:25:27 +08:00

18 lines
309 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

常见错误
===
# 判断一个对象是否是数组
下面是宁朗写的:
```
if (color.constructor !== Array) {
throw new Error("The color should be Array");
}
```
下面是Underscore的方法
```
_.isArray = nativeIsArray || function(obj) {
return toString.call(obj) == '[object Array]';
};
```