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

137
Views
¿Hay alguna forma de acortar este código para devolver el objeto?

Quiero hacer este código más corto.

 const coupons = rets.map((ret) => ({ coupon_id: ret.coupon_id, bot_id: ret.bot_id, lang_cd: ret.lang_cd, coupon_name: ret.coupon_name, start_date: ret.start_date, end_date: ret.end_date, coupon_data: ret.coupon_data, title: ret.title, sub_title: ret.sub_title, image: ret.image, style: ret.style, section: ret.section, button_pc: ret.button_pc, }));

Obtengo rets de DB.

Intenté como a continuación por mi cuenta, pero no funcionó bien. el error dice como [la columna es una cadena].

 const couponColumns = [ 'coupon_id', 'bot_id', 'lang_cd', 'coupon_name', 'start_date', 'end_date', 'coupon_data', 'title', 'sub_title',' image', 'style', 'section', 'button_pc' ] const coupons = rets.map((ret) => ({ couponColumns.map((column) => { column: ret.column } }));
about 4 years ago · Juan Pablo Isaza
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!