87
rated 0 times
[
90]
[
3]
/ answers: 1 / hits: 70012
/ 9 Years ago, sat, may 16, 2015, 12:00:00
I'm getting the following error on browser console
Uncaught TypeError: rand.slice is not a function
JavaScript
var rand, date;
date = Date.now();
rand = Math.random() * Math.random();
rand = Math.floor(date * rand);
rand = rand.slice(-5);
document.getElementById(test).innerHTML = rand;
I'm not able to figure it out what's wrong with this code.
More From » javascript