News for hackers. Stuff that matters.
Re:ES7 brings two new features by tomatsu on Saturday October 14, 2017 @10:05AM (#15472210)
Too bad it was renamed. "Contains" was a much better name.

"Contains" is used everywhere else - the DOM API included (Element.classList.contains).

Re:ES7 brings two new features by runarberg on Saturday October 14, 2017 @11:07AM (#15472477)
If I remember correctly, the array methods `.includes`, `.every`, and `.some` were renamed because of collision with prototype.js's `.contains`, `.all`, and `.any` respectively.
Re:ES7 brings two new features by haukur on Saturday October 14, 2017 @11:30AM (#15472585)
It's very unfortunate that the APIs of libraries that extend JavaScript builtins affect the development of the language to this degree.
Re:ES7 brings two new features by eximius on Saturday October 14, 2017 @05:38PM (#15474462)
That is the stupidest thing I've ever heard. Why would that matter? That would encourage me the naming choice was in the right direction!
Re:ES7 brings two new features by thaiphanvevo on Saturday October 14, 2017 @07:56PM (#15475010)
Lots of websites still use Prototype.js. Magento still has it as a dependency. Don't want to break the web!
Re:ES7 brings two new features by curtisblaine on Monday October 16, 2017 @12:08PM (#15484254)
Would it be bad though? A lot of APIs change in the browser space. WebRTC was broken a hundred times. Libraries depending on Prototype would probably be old, maybe insecure. You need to break it from time to time, you can't be backwards compatible all the time.
Re:ES7 brings two new features by eximius on Sunday October 15, 2017 @05:35PM (#15479425)
Would it break the web though? Wouldn't they just override the native implementation with a JS one?
Re:ES7 brings two new features by curtisblaine on Monday October 16, 2017 @12:05PM (#15484227)
Then the two implementations would probably be incompatible (different signatures, different implementation / return values) and would cause unexpected errors down the chain. So, essentially, breaking the web and making it difficult to fix it.
Re:ES7 brings two new features by devmunchies on Saturday October 14, 2017 @11:16AM (#15472523)
`.includes()` is used in lodash so lots of JavaScript developers are already used to that anyway.
Re:ES7 brings two new features by Macha on Saturday October 14, 2017 @12:38PM (#15472937)
Lodash switched to using includes when it became clear the standard was going to use includes. See e.g. Lodash 2 docs which had contains as the standard name, and `include` as the alias: https://lodash.com/docs/2.4.2#contains