function getNum() {
const num = Math.floor(Math.random() * 10);
}
Math.floorOrig = Math.floor;
Math.floor = (n) => {
window.num = Math.floorOrig(n)
return window.num;
}
function getNum() {
const num = Math.floor(Math.random() * 10);
}
getNum();
console.log(window.num);
function getNum() {
const num = Math.floor(Math.random() * 10);
}
function getNum() {
return Math.floor(Math.random() * 10);
}
console.log(getNum());