HE Shi-Jun
HE Shi-Jun
As I understand, "zalgo" means you should not sometime return promise sometime not, but throw errors for preconditions is not the case. Actually built-in promise methods also have that: if...
Note https://blog.izs.me/2013/08/designing-apis-for-asynchrony actually have an example of throwing synchronously. And node.js callback-based api have many such usage. Theoretically there are two types of errors, one is like return value in...
Another benefit may be it could provide a way to refer the class, for example `new static`.
Yeah, it bring ambiguity in sloppy mode, but I would argue that it won't be worse than the similar issues of `await/yield`. 😂
Note, there are also polyfills which do not introduce new features but just fix bugs, for example: https://github.com/fanmingfei/array-reverse-ios12 > There could be another attribute to let the developer force the...
Higher-order iterator need to set its `back` property accordingly. For example, `Iterator.prototype.map()` should use the `this.back` as the `back` value of returned iterator. It seems we can't achieve that using...
> and you can't usually move to an earlier point in the control flow in JavaScript. @bakkot You may misunderstand what double-ended mean. It doesn't mean move to early point...
@conartist6 First, pls notice my previous comment, deiter is not bidirectional, it will never be "calling [Symbol.iterator] is really two iterators", and with current design, u could just use generator...
@bakkot Yeah, the point is the _control flow_ . The control flow work in particular way to represent the logic of *how to generate the next value*. So yes, if...
@bakkot For example, this is the current logic of Array.prototype.values if write in generator: ```js Array.prototype.values = function *values() { let next = 0 while (next < this.length) { yield...