andrewplummer / Sugar

A Javascript library for working with native objects.
https://sugarjs.com/
MIT License
4.53k stars 306 forks source link

Array Docs - example for find uses assignment operator, not comparison operator #633

Closed graham-sportsmgmt closed 6 years ago

graham-sportsmgmt commented 6 years ago

The docs for Array.find use the wrong operator in the example.

Current:

users.find(function(user) {
  return user.name = 'Harry';
});

Should be:

users.find(function(user) {
  return user.name == 'Harry';
});
andrewplummer commented 6 years ago

Good catch! Thanks will fix.

graham-sportsmgmt commented 6 years ago

We're using sugarjs extensively and loving it, please let me know if there's something I can do to help with this project.

andrewplummer commented 6 years ago

Happy to hear it! Will let you know!

andrewplummer commented 6 years ago

Updated! Thanks!