rmp2150 rmp2150 - 19 days ago 5
Node.js Question

In Node JS, what is the difference between Require Express and HTTP together and separately

This is probably a very basic question.

But what is the difference between these two code snippets:

const express = require ('express');
const http = require ('http');


And

const express = require ('express'),
http = require ('http');

Answer

There's no difference. The docs state that you can initialize one or more variables with comma separation.

const name1 = value1 [, name2 = value2 [, ... [, nameN = valueN]]];
Comments