Skip to main content
Module

x/isx/mod.ts>isEmpty

TypeScript-first is function collections
Go to Latest
function isEmpty
import { isEmpty } from "https://deno.land/x/isx@1.0.0-beta.19/mod.ts";

Whether the value is empty or not.

Parameters

value: unknown
  • Any value.
import { isEmpty } from "https://deno.land/x/isx@$VERSION/mod.ts"
import { assertEquals } from "https://deno.land/std@$VERSION/testing/asserts.ts"
assertEquals(isEmpty(""), true)
assertEquals(isEmpty([]), true)
assertEquals(isEmpty({}), true)
assertEquals(isEmpty({ a: "b" }), false)

Returns

boolean