CyrefJS
CCyrefJS
فا
Back to documentation
Function/Since 1.38.0

noop

A function that performs no operation and returns undefined.

Returns

void

Returns undefined because the function has no return statement.

Examples

01

Basic usage

Calling noop performs no operation.

TypeScript
noop();

console.log("Done");
// Done
02

As a default callback

noop can be used when a callback is optional but a function is still required.

TypeScript
const onComplete = noop;

onComplete();
// No operation
03

Calling it with arguments

The function does not accept any parameters, so it should be called without arguments.

TypeScript
noop();
04

No return value

The function has a void return type and contains no return statement.

TypeScript
const result = noop();

console.log(result);
// undefined
Built with@cyref/js·Official documentation