Is there a way to store the result of a substitution parameter/string? For example, I want to store the following output into a variable.
console.log('%j', {foo: 123, bar: 'abc'});
Output:
{"foo":123,"bar":"abc"}
I already know JSON.stringify
e.g.
const s = JSON.stringify({foo: 123, bar: 'abc'});