From 4936c411945f6e6cd369a348a9262b2e214bd299 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Tue, 13 Dec 2016 01:39:28 +0200 Subject: [PATCH] doc: fix an output example in repl.md Make `_` reassignment example match more with the current output. Extend the example for more clarity. PR-URL: https://github.com/nodejs/node/pull/10244 Reviewed-By: Anna Henningsen Reviewed-By: Sakthipriyan Vairamani Reviewed-By: James M Snell --- doc/api/repl.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/api/repl.md b/doc/api/repl.md index 55549b259467ab..3568edf66ff841 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -140,6 +140,7 @@ global or scoped variable, the input `fs` will be evaluated on-demand as The default evaluator will, by default, assign the result of the most recently evaluated expression to the special variable `_` (underscore). +Explicitly setting `_` to a value will disable this behavior. ```js > [ 'a', 'b', 'c' ] @@ -147,11 +148,14 @@ evaluated expression to the special variable `_` (underscore). > _.length 3 > _ += 1 +Expression assignment to _ now disabled. +4 +> 1 + 1 +2 +> _ 4 ``` -Explicitly setting `_` to a value will disable this behavior. - ### Custom Evaluation Functions When a new `repl.REPLServer` is created, a custom evaluation function may be