Closed
Description
let f = (x: JSON.t) => switch x {
| Null => Console.log("null")
| _ => ()
}
is compiled to
function f(x) {
if (!(!Array.isArray(x) && (x === null || typeof x !== "object") && typeof x !== "number" && typeof x !== "string" && typeof x !== "boolean")) {
return ;
}
console.log("null");
}
Ideally, this would just be
function f(x) {
if (x === null) {
console.log("null");
}
}
Metadata
Metadata
Assignees
Labels
No labels