fr

Daily Challenge 🗓️

Your daily dose of technical intelligence to shine in (developer) society.

Discover a software development quiz per day with its detailed correction.

Frontend, Backend, Mobile, Data, Web, AI, Infra... Everything that can be coded!

Monday 12 October 2026

-

Node.js

Node.js #14/49

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 1040 times
0
Reviews from developersNo one has reviewed this question yet, be the first!

About Daily Challenge 🗓️

From Monday to Friday, discover each day a quiz question with its detailed answer to enrich your tech knowledge. The questions are proposed by the WeLoveDevs.com community: experienced developers, trainers and freelancers.WeLoveDevs.com helps developers to find their dream job. We also provide over 50 free technical tests in different technologies for those of you who would like to test your knowledge.

History

⚠️
Your browser is badly|not supported!
We recommend you to use a more modern browser such as Edge, Chrome or Firefox
Know More