Reputation: 14980
Why I keep getting the
"Uncaught TypeError: segEnDia.split is not a function"
in this example that I want to make it work?
var cantidadDada = 1000;
var segEnDia = cantidadDada / 86400;
var segEnDiaSplit = segEnDia.split(".");
Thanks!
Upvotes: 0
Views: 282
Reputation: 787
segEnDia
is not a string but a number. You have to convert the value to a string. Try this:
var cantidadDada = 1000;
var segEnDia = cantidadDada / 86400;
var segEnDiaSplit = ("" + segEnDia).split(".");
Upvotes: 2