Async/await makes it finally possible to handle both synchronous and asynchronous errors with the same construct, good old
try/catch. In the example below with promises, the
try/catch will not handle if
JSON.parse fails because it’s …
The copy attribute has been around since the beginning — and it’s commonly put to great use with class clusters. What’s happening here is that sending a copy message to something that is mutable (i.e. the NSMutableArray here) will still return an immutable copy. Copy on write makes life even faster in such a scenario.