+ 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 ?

4th Feb 2018, 11:31 AM
NoxFly
NoxFly - avatar
1 Answer
+ 7
// Specify the end limit. This should work: var a = score.toString().substring(0, 1); var b = score.toString().substring(1);
4th Feb 2018, 12:08 PM
Dev
Dev - avatar