size
Gets the size of an array, object or string.
- Get type of
val
(array
,object
orstring
). - Use
Array.prototype.length
property for arrays. - Use
length
orsize
value if available or number of keys for objects. - Use
size
of aBlob
object created fromval
for strings. - Split strings into array of characters with
split('')
and return its length.