Skip to main content
Module

x/somefn/js/obj.ts>isEmpty

some functions for deno and browser
Latest
function isEmpty
import { isEmpty } from "https://deno.land/x/somefn@v0.1.1-jsr/js/obj.ts";

是否为空

  1. undefined, {}, {a:undefined}, [], [undefined] is empty.
  2. null, 0, '', 0n, false, {a:null}, [null] is not empty.
  3. 支持 Map 和 Set.

Parameters

obj: unknown

Returns

boolean

是否为空, true 为 空, false 为非空