HE Shi-Jun
HE Shi-Jun
> Constructing a Map or a subclass calls this.set, and constructing a Set or subclass calls this.add, both observably. Oh NO.... Isn't it a spec bug? I can't understand why...
> that’s just something people need to know. Obviously I don't know it... and I can say at least 95%+ developers don't know it. 😢
Oh , I guess it's for subclasses...
With [extensions](https://github.com/tc39/proposal-extensions) proposal (I plan to rename it to "dispatcher" proposal), it's possible to support `null`. The initial proposed syntax is `stooges::Functor:map(stooge => stooge.toUpperCase())`, I'm also exploring other syntax options...
@michaelficarra I think protocol should use method style. Even we use function style, developers still facing the chaining problem and would ask for pipeline operator.
@Jamesernator > Just defer the `customElements.define` call until `DOMContentLoaded`: Normally developers just add `customElements.define()` after the class declaration of the custom element. The code of deferring it is a little...
这个双重defineProp感觉没有必要啊,不想把count漏出来我们可以直接用个block包一下就好啦: ```js { let count = 0; Object.defineProperty(globalThis, 'a', { get() { return ++count; } }); } ``` 另外side effect或者说泄漏了一个状态在 a === a - 1 这种奇异行为面前简直是小巫见大巫,不,是咪咪巫见格格巫!所以我觉得就不用care了 😛
Choice A: `bar` is an instance variable which each instance of `Whatever` have a individual `bar` value 选择A:`bar`是一个实例变量,每个`Whatever`的实例都有各自的`bar`值 `3:12` `4:22`
Choice B: `bar` is a bit like `foo` which shared by all the instances 选择B:`bar`跟`foo`差不多,所有实例访问的是同一个 `3:22` `4:23`
@SmallGress This is not *which is better* question. Don't think too much about it. Just use your intuition. 这不是一个“哪一个更好”的问题。不要想得太多,直接按你的第一直觉来就好了。 @amio This is not a poll for which is the better...