4 months ago

Log multiple variables to the JS console with their names

var x = 2;
var y = 3;
var z = 'hello';
console.log({x, y, z});

This will print out the following: > {x: 2, y: 3, z: "hello"}

Do you have any comment on this tricks? then let the author know about that. comment here