Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 885 Bytes

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

File metadata and controls

28 lines (21 loc) · 885 Bytes
title category date topics
Log a value to the Console
Tip
2021-02-27 09:50:00 +7
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' }

See also