Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

105
Views
Module can't use multiple objects

I have a module created using module.exports and I can't use multiple javascript objects at my module

that's my "app.js" file:

const object2csv = require('./object2csv.js');
  object2csv(
      { id: 1 }, { id: 2 }, { id: 3 }
  )

and that's my "module.js" file:

module.exports = function (arr){
console.log(arr)
}

output:

{ id: 1 }

How can I use my all objects? Can I use forEach in modules? Please answer with examples I'm newbie.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

you should send them as array

const object2csv = require('./object2csv.js');
object2csv([{ id: 1 }, { id: 2 }, { id: 3 }]);
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!