Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/somefn/js/obj.ts>isEmpty

some functions for deno
Go to Latest
function isEmpty
import { isEmpty } from "https://deno.land/x/somefn@v0.27.0/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 为非空