Post image
Light Mode
Dark Mode
JS High Stakes: Performance, Patterns, & Poker

Hello, checkiomates🐱‍👤!

This week's JavaScript digest takes you on a high-octane ride, beginning with the incredible feat of running a million real-time chess boards in a single process. We then refine our coding toolkit with expert tips for mastering regular expressions and ponder the wisdom of focusing on core JavaScript principles rather than endlessly chasing new web frameworks. To top it all off, we deal you a challenging mission: converting poker hands into their precise shorthand form and calculating their value according to specific rules.

💡TIP

You may click on any mission tag and see all missions, where this tag is present!
If you want to discover all CheckiO features, visit our tutorial. It's a longread, but it's worth it!

🏁MISSION

Bridge Routine by freeman_lex -

Hands are often given in abbreviated form that makes their relevant aspects easier to visualize at a glance. In this abbreviated shorthand form, suits are always listed in the exact order of spades, hearts, diamonds, clubs, so no special symbols are needed to show which suit is which. Your function must return a number of points and a shorthand form of a given hand.

assert.deepStrictEqual(
    bridgeRoutine(
        [
            ["four", "spades"],
            ["five", "spades"],
            ["ten", "hearts"],
            ["six", "hearts"],
            ["queen", "hearts"],
            ["jack", "hearts"],
            ["four", "hearts"],
            ["two", "hearts"],
            ["three", "diamonds"],
            ["seven", "diamonds"],
            ["four", "diamonds"],
            ["two", "diamonds"],
            ["four", "clubs"],
        ],
        "diamonds"
    ),
    [8, "xx QJxxxx xxxx x"]

📖ARTICLES

Running a million-board chess MMO in a single process -

One Million Chessboards is a 1000x1000 grid of chess boards. Moving a piece moves it for everyone, instantly. There are no turns, and pieces can move between boards.

Tips for making regular expressions easier to use in JavaScript -

Dr. Axel asks us to imagine if we had to write JavaScript without any whitespace or comments, so why should we have to write regexes that way? He has some tips for making the process more pleasant.

No Time To Learn (Web) Framework X -

How can you judge when it’s worth the time to learn something new?

👩‍💻CODE SHOT

What do you think the following code does?

var ?????????? = (items: any[], k: number, count: Object = {}): any[] => 
    items.filter((v: number): boolean => (count[v] = (count[v]??0) + 1) <= k);

🙌 Thanks for your attention! Hope to meet you at CheckiO, as well as at our Instagram and Twitter! We are really interested in your thoughts! Please, leave a comment below! ⤵

Created: July 8, 2025, 6:06 p.m.
0
17
User avatar
freeman_lex