Javascript isnull
return results == null ? 0 : (results[1] || 0);
the most terse solution would be to change return results[1] || 0;
to return (results && results[1]) || 0
.
return results == null ? 0 : ( results[1] || 0 );
return results == null ? 0 : (results[1] || 0);
the most terse solution would be to change return results[1] || 0;
to return (results && results[1]) || 0
.
return results == null ? 0 : ( results[1] || 0 );