Using – JavaScript
2 points
11 hours ago
| 1 comment
| developer.mozilla.org
| HN
andrewaylett
11 hours ago
[-]
TC39 level three, and I don't follow TC39 that closely but it seems to be available everywhere except Safari and I'd not seen it yet.

I'm not entirely sure whether I like it — I probably need to try using it for a bit (pun obviously intended) before making my mind up. Making it a variable declaration style rather than explicit syntax (like Java's try-with-resources) makes me slightly uneasy, as it's a change in semantics from "normal" declarations. It's not like Rust or C++ where we expect destructors to be called at the end of the scope, and it feels like it's going to be hard to work out where a variable marked "const" should have been marked "using".

reply