-2

I am new to JavaScript. Is there a way to see the Hello 5 times instead see it showing that it was printed 5 times?

enter image description here

isherwood
  • 58,414
  • 16
  • 114
  • 157
xodat51
  • 27
  • 2
  • https://stackoverflow.com/questions/5584835/why-does-google-chrome-group-identical-console-log-messages shows how to disable this in the Chrome console. Check the VSCode settings to see if it has something similar. – Barmar Feb 09 '22 at 19:24

2 Answers2

0

Disable the setting:

Debug > Console: Collapse Identical Lines

Controls if the debug console should collapse identical lines and show a number of occurrences with a badge.

Mark
  • 143,421
  • 24
  • 428
  • 436
-1

Just put a counter with the console logs to see hello 5 times. Like

const a = [1, 2, 3, 4, 5];
a.forEach((num) => console.log(num, "hello"))