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
To exit the REPL, you can type . exit , or press CTRL+D once, or press CTRL+C twice, which will return you to the shell prompt.
Press Ctrl+C to terminate the current command. Pressing Ctrl + C twice causes the REPL to quit. Press Ctrl+D to exit the REPL. Pressing up and down arrow keys you can see command history and modify previous commands.
REPL stands for Read Eval Print Loop and it represents a computer environment like a Windows console or Unix/Linux shell where a command is entered and the system responds with an output in an interactive mode. Node.js or Node comes bundled with a REPL environment.
To exit from the REPL terminal, press Ctrl + C twice or write . exit and press Enter.
Why don't you just append ; null;
to your expression?
As in
new Array(10000); null;
which prints
null
or even shorter, use ;0;
Assign the result to a variable declared with var
. var
statements always return undefined
.
> new Array(10)
[ , , , , , , , , , ]
> var a = new Array(10)
undefined
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With