基本否定函数:not(true) to return false

Basic Negationsfunction: not(true) to return false

使用逻辑非运算符,如何创建一个函数,其中一个布尔参数为 return not(false) 为真,not(true) 为假?

function returnNot(val) {
return !val
}