Search code examples
javascriptnode.jsread-eval-print-loop

Prevent Node.js repl from printing output


If the result of some javascript calculation is an array of 10,000 elements, the Node.js repl prints this out. How do I prevent it from doing so?

Thanks


Solution

  • Why don't you just append ; null; to your expression?

    As in

    new Array(10000); null;
    

    which prints

    null
    

    or even shorter, use ;0;