Skip to main content

New answers tagged

1 vote

Negamax AI for playing Connect Four against Alpha-beta pruning AI in Javascript

D.R.Y. code (Don't Repeat Yourself) Not a full review but it was painful to see all the repeated code so had to say something. OMDG... The code is very repetitive! In two objects there are groups of ...
Blindman67's user avatar
  • 22.2k
3 votes
Accepted

Extract each occurrence from an array of objects

Your explanation of what the code does is a little bit unclear. The algorithm you've shown dedupes an array of objects based on ids, choosing the first occurrence of each id. It's not so much that you'...
ggorlen's user avatar
  • 3,670
1 vote

Creating an API secured only by the request signature

HMAC vs signature secured only by the request signature I don't understand the title, given that the OP code uses an HMAC instead of calling some PK .sign() routine. HMAC offers integrity and ...
J_H's user avatar
  • 29.4k
2 votes
Accepted

Listening to bootstrap 5 events in a vuejs application

There is always a chance that the event name could change in future versions though that should be documented in a log of changes. While it hasn’t been updated to use bootstrap 5, there is a bootstrap-...
Sᴀᴍ Onᴇᴌᴀ's user avatar
3 votes

Lotto Number Generator - Javascript

id not class Use element id to uniquely identify elements, not ...
Blindman67's user avatar
  • 22.2k
7 votes
Accepted

Lotto Number Generator - Javascript

When you find yourself doing thing1, thing2, thing3, ... ...
ggorlen's user avatar
  • 3,670
2 votes

Combining multiple regexps using the `|` operator and grouping the regexps by their flags

This code does not yet have a strong design, nor would it easily be maintained by a team. specification Thank you for the Review Context, it is somewhat helpful. Certainly it is much, much better than ...
J_H's user avatar
  • 29.4k

Top 50 recent answers are included