How to Stop JSON Stringify From Dropping BigInt
JSON.stringify throws on BigInt and breaks APIs.

How to Stop JSON Stringify From Dropping BigInt
JSON.stringify throws on BigInt and breaks APIs.

What's wrong with this JavaScript BigInt mixing with Number?
What's wrong with this JavaScript BigInt mixing with Number in a calculator. The JavaScript code adds BigInt and Number. In JavaScript this throws and crashes the app.
#whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascriptreliability #javascriptapi #jav...

What's wrong with this JavaScript Object.assign overwriting?
What's wrong with this JavaScript Object.assign overwriting nested objects. The JavaScript code uses Object.assign for config merge. In JavaScript nested objects are copied by reference and get overwritten.
#whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #ja...

Why does this JavaScript NaN break every comparison?
Why does this JavaScript NaN break every comparison in a validator. The JavaScript code uses === to check for NaN but NaN is not equal to itself. In JavaScript forms invalid numbers pass silently.
#whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascriptreliabilit...

How to Get Unique Values in One Line
Set removes duplicates. Spread back to array. No loop.

flatMap Can Filter AND Transform?!
flatMap is a SECRET WEAPON! Return empty array to REMOVE items, return array with value to KEEP. One pass does filter AND map together! This trick will make your code 10x cleaner!
#javascript #javascripttricks #flatmap #arrayfilter #arraytransformation #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascripttips #functionalprogramming #advancedjavascript

How to Use Symbol for Unique Keys
Symbols never collide. Private-ish. Perfect for metadata.

Why does this JavaScript toFixed return string?
Why does this JavaScript toFixed return string in a sum. The JavaScript code uses toFixed for display and then adds the result. In JavaScript toFixed returns a string so addition concatenates.
#whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascriptreliability #javasc...

Why does this JavaScript Object is vs === for NaN?
Why does this JavaScript Object is vs === for NaN check. The JavaScript code uses === to detect NaN. In JavaScript Object.is is needed for NaN and negative zero.
#whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascriptreliability #javascriptapi #javascriptengineeri...

How to Clone Objects Deeply in One Line
structuredClone. Built-in. No lodash. Handles nested.
