Storing information in array in Node.js

I'm using Node.js and I need to store some information. If I use a JavaScript array to do this, will that be permanent or will the array disappear if the server stops? Does the server ever stop looping with Node.js? Sorry, I'm a beginner and not exactly sure how node.js works .. thanks for any help!!

If the server stops, it will be gone. If you need to persist data, store it in a database or serialize into a file on disk.

The array will disappear when the server stops.

The server keeps looping so long as it has a callback pending or a listener open, so a web server never stops looping.

I recommend you store your information in a database.

I've done this a couple times on startup projects to store session token information prior to spinning up the redis cluster.

While non-persistant data can be a problem, it's not always a deal breaker (think caching). Two bigger problems are:

1) For production environments when your application is balanced over multiple instances. Your users might not hit the same server and your javascript arrays will not match.

2) Growing mutable arrays can crash your node app/server.