tanda seru ganda JS
// "!!" converts a value to a boolean, then inverts it and then inverts it again.
// So let's say you want to check the value for a given variable:
const num = null;
if (num) { // false -> value is null -> evaluated as falsy
}
if (!num) { // true
}
if (!!num) { // false
}
// another example
const str = "Hello World";
if (str) { // true -> value is a "proper" (not empty) string -> evaluated as truthy
}
if (!str) { // false
}
if (!!str) { // true
}
Pl0erre