Skip to main content
Module

x/unknownutil/mod.ts>isArray

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

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

import { is } from "https://deno.land/x/unknownutil@v3.17.1/mod.ts";

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[]