Sorry about my terminology, this pattern probably exist in other languages and I just don't know the name of it.
Simply, if I want to create an if statement where a value must match 1 other value in a list.
const val = "big";
if (val === "tiny" || val === "small" || val === "medium" || val === "large") {
// valid size
}
There are a bunch of SO articles out there asking what the best solution is and there are many variations. But could something be built into the language eventually? I'm sure it has been discussed before, what were the outcomes?
Ideally, it could look something like ...
const val = "big";
if (val ==~ "tiny" || "small" || "medium" || "large") {
// valid size
}