【新提案】增加返回值更有意义的set.add、map.set方法 #64
Unanswered
LongTengDao
asked this question in
Ideas
Replies: 1 comment 2 replies
-
Is this the same as https://github.com/tc39/proposal-upsert ? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
返回
this
的方法过于鸡肋,但修改旧有api不可能了,不过突然想到有没有可能增加新的方法?map.set
清爽的对象写法:
现有的
map.set
写法:map.setValue
提案写法:set.add
清爽的删除写法:
现有的新增写法:
或:
不光啰嗦,性能还差。
set.addValue
提案写法:方法名可以再讨论。
Beta Was this translation helpful? Give feedback.
All reactions