Sorry for this noob question but I'm really not good with javascript. I have list of String which has number at the end:
- Test-001
- Test-002
- Test-003
I want to increment the numbers at the end of the String.
What I tried so far:
var test = 'Test-001';
var lastNum = test.split('-');
console.log( lastNum[1] + 1 ); // result: 0011
console.log( Number( lastNum[1] ) + 1 ) // result: 2
What I want to do is to produce results ( Test-001 up to Test-999 ).
Thank you in advance