Skip to main content
Module

x/denops_std/function/mod.ts>empty

📚 Standard module for denops.vim
Go to Latest
function empty
import { empty } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts";

Return the Number 1 if {expr} is empty, zero otherwise.

  • A List or Dictionary is empty when it does not have any items.
  • A String is empty when its length is zero.
  • A Number and Float are empty when their value is zero.
  • v:false, v:none and v:null are empty, v:true is not.
  • A Job is empty when it failed to start.
  • A Channel is empty when it is closed.
  • A Blob is empty when its length is zero.

For a long List this is much faster than comparing the length with zero.

Can also be used as a method:

mylist->empty()

Parameters

denops: Denops
expr: unknown

Returns

Promise<number>