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

148
Views
In Javascript why numbers that have leading zeros turn different when logged?

When I log the numbers in the array, the oens that have leading zeroes turn to be different:

const array = [0123,5202,150,0000015,0202020,1,001,0000000000];
array.forEach(n => {
    console.log(n) // logs this -> 83, 5202, 150, 13, 66576, 1, 1, 0
})
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

a number with leading zeros is an octal number in computer science that means that 010 == 8 and your 00015 == 13 because it is 8 + 5

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!