Skip to content

Function: location()

ts
function location(depth?: number): Location;

Returns the filename and line number of the caller in the call stack

Parameters

ParameterTypeDescription
depth?numberThe distance from the location function in the call stack. Defaults to 1 (caller).

Returns

Location

an object with the filename and line number.