Question from the Node.js test

Export a function from a NodeJS module in 2 different ways.

Hard

Considering the following utility module :

// UtilsModule.js
function getRandomInteger(){
  return Math.round(Math.random()* Number.MAX_VALUE);
}

Which I can export in 2 ways:

1.exports.getRandomInteger= getRandomInteger;
2. module. exports= getRandomInteger;

Is there a difference between these 2 ways of exporting?

Author: Jean-marie CléryStatus: PublishedQuestion passed 778 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!