I get the following error in the 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 canβt understand what is wrong with this code.
source
share