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

168
Views
Pattern Factory return [object Object] in my HTML

When I use my pattern factory for my slider, it returns me "[object Object]" instead of having HTML. Class code

HTML develop tools

Do you have any idea what could happen?

Thank you so much :)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Contructor cann't return anything, but the object he creates and returns internally. To avoid this behavior use something like.

   class MediaFactory {
      getContent(data, layout) {
         // your code goes here
      }

   }

and usage will be

....innerHtml = new MediaFactory().getContent(article, 'slider')
about 4 years ago · Juan Pablo Isaza 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!