← Back to Node.js Course | Chapter 1: Introduction | Lesson 5 of 7

Node REPL क्या है

REPL एक interactive prompt है जहाँ आप JavaScript type करते हैं और result तुरंत देखते हैं।

In this page:

  1. node REPL
Syntax
javascript
$ 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

bash
$ 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. #}
आम गलतियां
  1. REPL commands से पहले dot भूल जाना
  2. यह उम्मीद करना कि exit करने के बाद variables persist करेंगे
  3. .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:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.