Global Feed Post Login
Replying to Avatar Yonle

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.

Avatar
Lamp 1y ago

nostr:npub1x3azxuysp5vmfer4vgs4jn5tmfcx4ew8sh0qnev7gczljxsr7jwqa3g4el So the cases aren't blocks.

Reply to this note

Please Login to reply.

Discussion

Avatar
Yonle 1y ago

Yeah. Now you know.

Thread collapsed