I noticed that if i use the leading zeros are not removed. I also saw a lot of discussion on how keeping leading ze
You can try this.
str1 = str.replace(/^0+/,'');