MCPcopy
hub / github.com/autoNumeric/autoNumeric / isArray

Method isArray

src/AutoNumericHelper.js:240–248  ·  view source on GitHub ↗

* Return `true` if the parameter is an Array * //TODO Replace this by the default `Array.isArray()` function? * * @param {*} arr * @throws Error * @returns {*|boolean}

(arr)

Source from the content-addressed store, hash-verified

238 * @returns {*|boolean}
239 */
240 static isArray(arr) {
241 if (Object.prototype.toString.call([]) === '[object Array]') { // Make sure an array has a class attribute of [object Array]
242 // Test passed, now check if is an Array
243 return Array.isArray(arr) || (typeof arr === 'object' && Object.prototype.toString.call(arr) === '[object Array]');
244 }
245 else {
246 throw new Error('toString message changed for Object Array'); // Verify that the string returned by `toString` does not change in the future (cf. http://stackoverflow.com/a/8365215)
247 }
248 }
249
250 /**
251 * Return `true` if the parameter is a DOM element

Callers 11

isNumberMethod · 0.95
isInArrayMethod · 0.95
_setArgumentsValuesMethod · 0.80
_parseStyleRulesMethod · 0.80
updateMethod · 0.80
initMethod · 0.80
unformatMethod · 0.80
AutoNumeric.jsFile · 0.80
isObjectMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected