In my .NET backend, I am utilizing HasFlag() to handle enum authorization.
Enum Foo {
0: Zero,
1: One,
2: Two,
3: Three,
..
}
5.HasEnum(Foo.One) is falsy because 5 is equal to 3 + 2
6.HasEnum(Foo.One) is truthy because 6 is equal to 3 + 2 + 1
What approach can be taken in JavaScript to achieve the same functionality?
I have a role value that falls within the range of > 0 and < 1048, how can I determine if it contains a role corresponding to 32?