I have a function and if statement that I need to print "even" in the console. The statement is literally, "If num is an even number, print out "even". Don't do anything if num is an odd number."
I thought it would work if I put (num) equal to Math.random. But I got undefined. I also tried setting (num) equal to a specific number and I'm still getting undefined in the console.
How do I get this to print "even"?
function isEven(num) {
let random = Math.random();
if (num = random ){
console.log("even");
}
}