Skip to content

isNull

A função isNull verifica se o valor fornecido é exatamente null.

Sintaxe

typescript
isNull(value: any): value is null;

Parâmetros

NomeTipoDescrição
valueanyValor a ser verificado

Retorno

TipoDescrição
booleanVerdadeiro se for null

Exemplos

typescript
isNull(null); // => true
isNull(undefined); // => false
isNull(0); // => false

Notas

  • Útil para validação de valores nulos explicitamente.

Referências

Released under the MIT License.