@JavaScriptBuzz

8 Followers
2 Following
193 Posts
Your daily hit of JavaScript hacks, fixes, and mind popping tricks

How to Stop JSON Stringify From Dropping BigInt

JSON.stringify throws on BigInt and breaks APIs.

#javascript #bigint #json #api #howto #bug

https://www.youtube.com/watch?v=lIdJY-9OxWc

How to Stop JSON Stringify From Dropping BigInt #javascript

YouTube

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...

https://www.youtube.com/watch?v=Ldda7gXnons

Whats wrong with this JavaScript BigInt mixing with Number? #javascriptnumber

YouTube

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...

https://www.youtube.com/watch?v=WLF_6Q9d75Y

Whats wrong with this JavaScript Object.assign overwriting? #javascriptcodereview

YouTube

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...

https://www.youtube.com/watch?v=coD1e_eGT5w

Why does this JavaScript NaN break every comparison? #javascriptengineering

YouTube

How to Get Unique Values in One Line

Set removes duplicates. Spread back to array. No loop.

#javascript #set #unique #dedupe #howto

https://www.youtube.com/watch?v=YHHrQXDsmTQ

How to Get Unique Values in One Line #set

YouTube

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

https://www.youtube.com/watch?v=b3SGNML931E

flatMap Can Filter AND Transform?! #JavaScript

YouTube

How to Use Symbol for Unique Keys

Symbols never collide. Private-ish. Perfect for metadata.

#javascript #symbol #unique #howto

https://www.youtube.com/watch?v=ZfH0q38Kjuo

How to Use Symbol for Unique Keys #howto

YouTube

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...

https://www.youtube.com/watch?v=x0GQuQEY6Yw

Why does this JavaScript toFixed return string? #javascriptperformance

YouTube

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...

https://www.youtube.com/watch?v=ViTzYGW4VsQ

Why does this JavaScript Object is vs for NaN? #whatswrongwiththisjavascriptcode

YouTube

How to Clone Objects Deeply in One Line

structuredClone. Built-in. No lodash. Handles nested.

#javascript #structuredclone #clone #howto

https://www.youtube.com/watch?v=1lN1Gq4ENWw

How to Clone Objects Deeply in One Line #clone

YouTube