Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node example.js and three dots, what's next?

Tags:

node.js

Refering to the homepage and the documentation, I installed node.js, created example.js and ran the script. But I got 3 dots (...) and nothing else. Where should I look?

> node example.js
...

Running this on Windows 7 x64

like image 843
Jake Avatar asked Dec 24 '13 07:12

Jake


People also ask

What does three dots mean in Nodejs?

(three dots in JavaScript) is called the Spread Syntax or Spread Operator. This allows an iterable such as an array expression or string to be expanded or an object expression to be expanded wherever placed. This is not specific to React. It is a JavaScript operator.

How can use 3 dots with JavaScript?

Rest operator. When used within the signature of a function, where the function's arguments should be, either replacing the arguments completely or alongside the function's arguments, the three dots are also called the rest operator.

What does 3 dots mean in Typescript?

The three dots are known as the spread operator from Typescript (also from ES7). The spread operator return all elements of an array. Like you would write each element separately: let myArr = [1, 2, 3]; return [1, 2, 3]; //is the same as: return [...myArr];

What do three dots mean in HTML?

The HTML entity … generates the glyph called a horizontal ellipsis. This is what typographers use … to represent three dots ( when they mean something is omitted ). – O.


1 Answers

It appears that you have run node.exe, which opens a terminal, and have typed node example.js into that terminal.

So basically, you opened node in an interactive terminal, and then typed node example.js, so it is trying to run that as if it were JavaScript. It shows the three dots because that is not valid JavaScript code, and it is waiting for you to type more code that might make it valid.

You should be running node.exe example.js from a cmd prompt, where you'd see a prompt more like C:\>.

like image 83
loganfsmyth Avatar answered Sep 28 '22 09:09

loganfsmyth