0

Delete leading zeros from the string in JavaScript

JavaScript
var s = "0000test";
while(s.charAt(0) === '0') {
 	s = s.substr(1);
}

console.log(s);
RUN
add comment
Suggest a different solution or add another example