Explicitly checking for key in js array before checking its value.