rmp2150 rmp2150 - 1 year ago 118
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');


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

Answer Source

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]]];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download