-
Notifications
You must be signed in to change notification settings - Fork 1
Function_evisit_core_js_utils_sizeof
Wyatt Greenway edited this page Jan 31, 2017
·
3 revisions
- obj
- (Object|String|Array) >>> Object, Array, or String to report size on
- (Number) Size / length of object
Return the size of an Object, Array or String. Size is ascertained in the following manner:
- If the object passed in has a "size" function, this will be called and the value returned will be the "size".
- If the object is an Array or a String, return the "length"
- If the object contains a "length" property, return that as the "size"
- If the object is an instance of Object, return the number of "keys" the plain object contains
- Otherwise return 0