Back to Functions

noop

util

A no-operation function that returns undefined regardless of the arguments it receives.

Installation

Import
import { noop } from '@tulx/utils';

Source Code

Implementation
/**
 * A no-operation function that returns undefined regardless of the arguments it receives.
 *
 * @returns Returns undefined.
 *
 * @example
 * ```ts
 * const object = { 'user': 'fred' };
 * noop(object) === undefined; // true
 * ```
 */
export function noop(): undefined {
  return undefined;
}

Example

import { noop } from '@tulx/utils';

const object = { 'user': 'fred' };
noop(object) === undefined; // true

Related Functions