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

86
Views
lint error related to return in subscription with more than one action

Hello developers I´m subscribing to a service , and on its next() if everytinh is fine , i do expect to do several things, but I´m receiving this lint error:

Unexpected use of comma operator     

the subscription would be kind of:

  someMethod(){
     someService.MySergvice().subscribe(
        ()=>{ return (action1,action2,action3)},
       .....
     )
  }

then i receive this error:Unexpected use of comma operator By the way i did try with this structure:

 someService.MySergvice().subscribe(
        ()=> (action1,action2,action3),
       .....
     )  )
  }

And kept the same How can i improve this situation?

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

0

The comma operator isn't commonly used like this. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_Operator for more details. In this situation, it's completely useless and doesn't make sense.

This is stuff you should be looking for in documentation first.

This may not be doing what you think. It's always returning action3. If you wanted to return an array, use square brackets instead.

 someService.MySergvice().subscribe(
        ()=> [action1, action2, action3],
       .....
     )  )
  }
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!