Node REPL क्या है
REPL एक interactive prompt है जहाँ आप JavaScript type करते हैं और result तुरंत देखते हैं।
In this page:
Syntax
$ node
> expression
node REPL
बिना arguments के node चलाना Read-Eval-Print Loop शुरू करता है। हर expression evaluate होता है और इसका result print होता है। Special commands एक dot से शुरू होते हैं, जैसे .help, .editor, और .exit, और underscore variable last result hold करता है।
Note:
REPL छोड़ने के लिए Ctrl+D दबाएँ या .exit type करें।
उदाहरण: node REPL
$ node
> 2 + 3
5
> const name = "Ada"
undefined
> `Hello, ${name}`
'Hello, Ada'
> _
'Hello, Ada'
> .exit
⚠️ Run this in your own terminal or Node.js environment.
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the
view already swaps in the hi_ translation fields (or blanks these
out if untranslated), so this renders correctly for both languages
without a lang_code check here. #}
आम गलतियां
- REPL commands से पहले dot भूल जाना
- यह उम्मीद करना कि exit करने के बाद variables persist करेंगे
- .editor mode के बिना multi-line code paste करना
चैप्टर सारांश
- node REPL शुरू करता है
- Results automatically print होते हैं
- _ last result hold करता है
- Commands एक dot से शुरू होते हैं
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: