console.log (an optional message and) a value and return the value.

Readme
1
2
3
4
export function debug<T>(value: T, message?: string): T {
message ? console.log(message, value) : console.log(value);
return value;
}
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.