0

It seems console.log() is the equivalent of System.out.println()

How to print strings in the same line with multiple calls?

Like:

for (let i=0;i<2;i++){
  console.log(i);
}

but print in the same line.

Owen Young
  • 157
  • 2
  • 8

1 Answers1

0

console.log is not the equivalent, it does other things toolike formatting objects.

You're looking for process.stdout:

  • process.stdout.write

and

  • process.stdout.writeln
Paul
  • 139,544
  • 27
  • 275
  • 264