Yonle on Nostr: Still a block. But doing without bracket is quite similar to this: ``` switch { let a ...
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.
Published at
2024-05-14 02:03:14Event JSON
{
"id": "9b0b944c1110c1ba34ceae230f3476f45e23e0f833d50cc5a3b920becdb140df",
"pubkey": "347a2370900d19b4e4756221594e8bda706ae5c785de09e59e4605f91a03f49c",
"created_at": 1715644994,
"kind": 1,
"tags": [
[
"e",
"b657dcbbf21736fedb6a5b27f48d4defe5c997faedc9b3f63ec5e3746956b67a",
"",
"root"
],
[
"e",
"ba391c976593a0f1c3d1852c682220896febf97790b69b6d0eb04d1335773187",
"",
"reply"
],
[
"p",
"347a2370900d19b4e4756221594e8bda706ae5c785de09e59e4605f91a03f49c"
],
[
"p",
"69c8971d2ad8c30a72bfc719a9941383205e7e0b274365dac90bdcccdf20ed5d"
]
],
"content": "Still a block. But doing without bracket is quite similar to this:\n```\nswitch {\n let a = 1;\n let a = 2; // the error arrives here\n case \"1\":\n // ....\n}\n```\n\nDoes not matter if you use let, var, or const tho.",
"sig": "63bc88e50556327620f6f5639fa037973fb20d09d9e144b32e8a18c153eae045df1ecbdeb18901a0a1eabfa0cce497d8bba8aaedd4add551d3147d130b0c9e04"
}