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

96
Views
Where to declare constants for single function

I have a function in service that is binded to several places (components) in code (path to current displayed img), I'm aware that probably better way would be binding variable and change it when needed, but I would like to know what is faster, better practice:

Declare some constants (I need about 5) inside this function and make these variables declared every change detection cycle runs
OR
Declare them as class variables and use them only in that one function (other parts of service don't need them)

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!