如何判断一个变量能否被2整除?此外,如果是,我需要执行一个函数,如果不是,我需要执行一个不同的函数。
使用模数:
// Will evaluate to true if the variable is divisible by 2 variable % 2 === 0