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
  • 61
  • 1
  • 6

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
  • 135,475
  • 25
  • 268
  • 257