I am doing a function to convert from binary to decimal and I needed to cut the entered number, and I got this question:
In it they explain that if you have an example number
var numero = 123456;
And you apply split () to get 1,2,3,4,5,6
var numero2=numero.split("");
var numero3=numero.splt();
It will not work.
But if you concatenate "" with the number:
var numero3=(""+numero);
var numero4=numero3.split("");
Returns 1,2,3,4,5,6
Why this works?