Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 1.1 KB

log-a-value-to-the-console.mdx

File metadata and controls

29 lines (22 loc) · 1.1 KB
category created tags title
Tip
2021-02-27
JavaScript
Log a value to the Console

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' }

See also