Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/testing/mock.ts>returnsArg

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function returnsArg
import { returnsArg } from "https://deno.land/std@0.198.0/testing/mock.ts";

Creates a function that returns one of its arguments.

Type Parameters

Arg
optional
Self = any

Parameters

idx: number

Returns

(this: Self, ...args: Arg[]) => Arg