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

245
Views
Ternary Javascript for HTML (Angular)

how can I change the following to ternary so I can use it in .HTML file

if (statusChange && statusChange === 'Employed') {
  return true;
} else {
  return employmentStatus === 'Employed'
}

i.e. assign the result of the second comparison only if the first if statement results to false

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

0

No need for ternary operation here, just use the or operation:

statusChange === 'Employed' || employmentStatus === 'Employed'

If the first part is true, the whole expression will return true. If it's false, it will check it the second part is true or false

Much cleaner

about 4 years ago · Juan Pablo Isaza Report

0

Simply:

return statusChange && statusChange === 'Employed' ? true : employmentStatus === 'Employed'
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!