Ray's playground

 

Arrays(Chapter 6 of JavaScript: The Good Parts)

code
1 var is_array = function (value) {
2     return value &&
3         typeof value === 'object' &&
4         typeof value.length === 'number' &&
5         typeof value.splice === 'function' &&
6         !(value.propertyIsEnumerable('length'));
7 };
8 

 

posted on 2010-07-11 20:19  Ray Z  阅读(161)  评论(0编辑  收藏  举报

导航