Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use sctrict';
- /**
- * Checks if value is an array.
- *
- * @author Douglas Crockford <douglas@crockford.com>
- * @see JavaScript The Good Parts, p. 61
- *
- * @param {*} value The value to be checked.
- * @returns {boolean}
- */
- exports.isArray = function (value) {
- return value &&
- typeof value === 'object' &&
- typeof value.length === 'number' &&
- typeof value.splice === 'function' &&
- !(value.propertyIsEnumerable('length'));
- };
Add Comment
Please, Sign In to add comment