Still a block. But doing without bracket is quite similar to this:
```
switch {
let a = 1;
let a = 2; // the error arrives here
case "1":
// ....
}
```
Does not matter if you use let, var, or const tho.
nostr:npub1x3azxuysp5vmfer4vgs4jn5tmfcx4ew8sh0qnev7gczljxsr7jwqa3g4el switch itself isn't a block?
well, i changed it to var.
Still a block. But doing without bracket is quite similar to this:
```
switch {
let a = 1;
let a = 2; // the error arrives here
case "1":
// ....
}
```
Does not matter if you use let, var, or const tho.
This is basically how JavaScript object works. This is common.
nostr:npub1x3azxuysp5vmfer4vgs4jn5tmfcx4ew8sh0qnev7gczljxsr7jwqa3g4el So the cases aren't blocks.
Yeah. Now you know.