我正在逐漸瀏覽器控制檯上看到以下錯誤遺漏的類型錯誤:rand.slice不是一個函數
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;
我現在無法推測它這個代碼出了什麼問題。