In nodeJS terminal, I can enter this expression and have as a return 'true':
> var x = true; x;
true
How can I capture this return value in a variable, without changing the expression?
The following is not working:
> var y = (var x = true; x)
SyntaxError: Unexpected token var
In node REPL, you can just use _
:
> var x = true; x;
true
> var y = _
undefined
> y
true
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