Javascript allows you to see what time it is in another timezone if you specify the IANA given name of that timezone. For example: Below you can see that IANA provides multiple names within each general timezone: Why is that necessary? For example, both America/Detroit and America/New_York are (generally) in the Eastern Time Zone. Why don’t these two locations share
Tag: ecmascript-next
JavaScript array .reduce with async/await
Seem to be having some issues incorporating async/await with .reduce(), like so: The data object is logged before the this.store completes… I know you can utilise Promise.all with async loops, but does that apply to .reduce()? Answer The problem is that your accumulator values are promises – they’re return values of async functions. To get sequential evaluation (and all but
Is there a way to short circuit async/await flow?
All four functions are called below in update return promises. What if we want to abort the sequence from outside, at any given time? For example, while fetchMetaData is being executed, we realize we no longer need to render the component and we want to cancel the remaining operations (fetchContent and render). Is there a way to abort/cancel these operations
One-liner to take some properties from object in ES 6
How one can write a function, which takes only few attributes in most-compact way in ES6? I’ve came up with solution using destructuring + simplified object literal, but I don’t like that list of fields is repeated in the code. Is there an even slimmer solution? Answer Here’s something slimmer, although it doesn’t avoid repeating the list of fields. It