Pardon the mess, Play My Code is in beta!

READY TO PLAY?
CLICK TO LOG IN!

sign up - lost password

isSet

.isSet( index )

Returns true if there is a value stored at the given index. This is regardless of if the value is null, or not null.

This is provided as a more human readable alternative to checking if an index is a valid index.

arr = [ 'foo', 'bar', null ]

isFound = arr.isSet( 0 ) // set to true
isFound = arr.isSet( 2 ) // set to true
isFound = arr.isSet( 10 ) // set to false