I have just come across a function in javascript which has return !1
I was just wondering what this actually meant?
Why would you return !1
or return !0
Could someone please explain what it means please?
Here is the function that I came across:
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
}
}
Thanks In advance!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…