SyntaxFix
Write A Post
Hire A Developer
Questions
I am using this simple approach
var input = 1000; //input any number var len = input.toString().length; for (i = 1; i < input; i++) { console.log("MyNumber_" + ('000000000000000' + i).slice(-len)); }