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

171
Views
Javascript Leading Zero Function as Argument

Exist some way that javascript recognize the leading zero as argument (with the primitive value as number)? I have this code:

    let noLeadinZero = (number) => { return number }

    console.log('noLeadinZero(00):', noLeadinZero(00)) // 0
    console.log('noLeadinZero(000):', noLeadinZero(000)) // 0
    console.log('noLeadinZero(0000):', noLeadinZero(0000)) // 0

Exist a way, beside the fact i can put the argument of the call of the function in string, for recognize the leading zeros?

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

0

No.

Numbers are just numbers. They don't have formatting.

If you want formatting, use a string.

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!