← #42 Replace multiple if statements with a single switch statement
#43

Log a value to the Console

Topics: JavaScript

There are a few ways to log a value to the Console, but using object destructuring is the convenient and short one.

const fullName = 'John Doe';

console.log('full name' + fullName);
console.log('full name', fullName);

// Better: use template string
console.log(`full name: ${fullName}`);

// Best: use object destructuring
console.log({ fullName }); // { fullName: 'John Doe' }

More

Fix a typo or suggest an improvement
#44 Use short-circuits conditionals