N
N
Nwton2016-05-12 01:16:32
JavaScript
Nwton, 2016-05-12 01:16:32

Why does node.js kill while?

There is a code:

var i = 0;
while(true){
  i++;
  console.log(i);
}

After ~300 000 the script stops and "Killed" is displayed in the terminal. Why is this happening?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2016-05-12
@Nwton

https://github.com/nodejs/node/issues/6379
However, writing to the terminal at such a speed is usually not necessary, and if you redirect the output, then there is no problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question