DEV Community

VICTOR OMONDI
VICTOR OMONDI

Posted on

1 2

Javascript: Printing Object in Console

If you're trying to print object in console and you're getting [object Object], then most probably you're trying to print the object as a string value. Add comma(,), and not plus operator(+)

Ex:

console.log('The value of object is: ' + obj) 

❌❌

console.log('The value of object is: ' , obj)

✔️✔️

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up