1
2
3
4
5
6
7
8
export const thisReference = (): {
userHandle: string;
valName: string;
callNumber?: number;
} =>
new Error().stack.match(/@@({.+?})@@/g).map((e) =>
JSON.parse(e.slice(2, -2))
)[1];
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
v2
October 23, 2023