I am using the console.log statement for debugging , but came across a scenario where using ',' or '+' with console.log statement is logging the output in different pattern.For example
(function() {
var x = [];
x.push({
a: 1,
b: 2,
}, {
a: 4,
b: 3,
}, {
a: 5,
b: 6
}, {
a: 7,
b: 8,
})
console.log('Logging with , ', x);
console.log('Logging with + ' + x);
}())
See Question&Answers more detail:os