error is in title, my code is
if (args[1].startsWith('0')) return;
i'm trying not to allow people to start the first argument with zero. i couldn't find anything on argument startwiths so i'm posting it.
error is in title, my code is
if (args[1].startsWith('0')) return;
i'm trying not to allow people to start the first argument with zero. i couldn't find anything on argument startwiths so i'm posting it.
First argument would be accessed as args[0]
If I'm reading your question correctly then this may be the cause of the problem. If there are less than 2 values in args then args[1] will be undefined.
You can target the first argument by the index 0 as JavaScript does not go from 1 to 10 but from 0 to 9 for example.