Skip to main content
Module

x/isx/mod.ts>isTruthy

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

Whether the value is TruthyLike or not.

Examples

Example 1

import { isTruthy } from "https://deno.land/x/isx@$VERSION/mod.ts"
import { assertEquals } from "https://deno.land/std@$VERSION/testing/asserts.ts"
assertEquals(isTruthy(1), true)
assertEquals(isTruthy("a"), true)
assertEquals(isTruthy(0), false)

Parameters

value: unknown
  • Any value.

Returns

value is TruthyLike