properties - VueJS int Props changing value on prefix with 0 -


i trying pass through int value prop.

so if call:

<job-cards-create :jobno="1203"></job-cards-create> 

i get:

answer fine

but if add 1 '0' infront:

<job-cards-create :jobno="01203"></job-cards-create> 

it gives:

answer way off

what going on? missing something?

this because number 01203 being interpreted octal number due leading zero. check out these examples:

01203 === 643 // true

01203.tostring() // "643"

here documentation on octals in js


Comments