Skip to main content
Module

x/unknownutil/is.ts>isArray

🦕 A lightweight utility pack for handling unknown type
Go to Latest
function isArray
import { isArray } from "https://deno.land/x/unknownutil@v3.18.0/is.ts";

Return true if the type of x is unknown[].

import { is } from "@core/unknownutil";

const a: unknown = [0, 1, 2];
if (is.Array(a)) {
  // a is narrowed to unknown[]
  const _: unknown[] = a;
}

Parameters

x: unknown

Returns

x is unknown[]