+ 4
[JQUERY] .substring()
I've var score = 12; I want to have 2 other variables which contains the 1 and the 2 : var a = score.toString().substring(0); var b = score.toString().substring(1); why it doesn't work ?
1 Answer
+ 7
// Specify the end limit. This should work:
var a = score.toString().substring(0, 1);
var b = score.toString().substring(1);