相关疑难解决方法(0)

在javascript中返回!1

我刚刚遇到一个javascript函数 return !1

我只是想知道这究竟是什么意思?

你为什么return !1或者return !0

有人可以解释一下这意味着什么吗?

这是我遇到的功能:

function convertStringToBoolean(a) {
    typeof a == "string" && (a = a.toLowerCase());
    switch (a) {
    case "1":
    case "true":
    case "yes":
    case "y":
    case 1:
    case !0:
        return !0;
    default:
        return !1
    }
}
Run Code Online (Sandbox Code Playgroud)

提前致谢!

javascript return function

17
推荐指数
2
解决办法
7348
查看次数

标签 统计

function ×1

javascript ×1

return ×1