I found a very interesting article on css-tricks.com to log a variable in JS console.
// my old-fashioned way
console.log("myVariable: ", myVariable);
// the much cooler way 😎
console.log({ myVariable });
This works because the shorthand assignment for objects expects the variable name is equal to the object key. In JS the example is interpreted as:
{
"myVariable": myVariable
}