is-null-like

2018-12-07 admin

is-null-like是什么

什么是is-null-like,A simple javascript function that will return true if the value is null like (aka undefined or null)

is-null-like使用教程帮助文档

NPM Version Build Status

is-null-like

A simple javascript function that will return true if the value is null like (aka undefined or null)

Installation

npm i --save is-null-like

Overview

describe( 'is-null-like', function () {
  it( 'should return true in case of null', function () {
    var isNullLike = require( '../' );

    expect( isNullLike( null ) ).to.be.true;
  } );
  it( 'should return true in case of undefined', function () {
    var isNullLike = require( '../' );
    var nodef;

    expect( isNullLike( nodef ) ).to.be.true;
  } );

  it( 'should return false if the value passed is an object or primitive', function () {
    var isNullLike = require( '../' );

    expect( isNullLike( 3 ) ).to.be.false;
    expect( isNullLike( {} ) ).to.be.false;
  } );
} );

License

MIT

Changelog

changelog

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-47552.html

文章标题:is-null-like

回到顶部