Difference between Number() and parseInt()
While Number()
and parseInt()
are similar, there are important differences. Let's explore them!
While Number()
and parseInt()
are similar, there are important differences. Let's explore them!
I recently stumbled upon the JavaScript equality table. I'm always impressed by nice ways of visualizing such concepts. And I immediately thought it would be a fun thing to build myself!
Choose between double equals and triple equals to see how that affects the equality table.
I recently stumbled upon a bug related to the subtle differences between mouse, touch and pointer events. The bug made me confused—and curious. What is actually the difference between these events?
I opened an issue for the bug that you can check out if you're also curious—but before trying to understand the bug, we need to set the stage with some knowledge around different types of events.
||
and ??
are similar, but there's some very important nuance. Take a look at this example:
const a = "" || "default value"
// > "default value"
const b = "" ?? "default value"
// > ""
Let me explain.
You live close to , right?
How did I know that? I used Ipapi! A neat API for getting the location of IP addresses, with 30,000 free lookups per month.
Consider this array of names:
const names = [
"Filip",
"Anna",
"Jennifer",
"Anna",
"Robert",
"Emma",
"Filip",
"Anna",
]
In this array, Filip
occurs two times and Anna
three times. What if we want filter out the duplicates and get an array with the unique names?
In this game, you're supposed to write the alphabet as fast as you can. Click the input box and start the game by typing the first letter of the alphabet. My highscore is 2.95 seconds. Beat that if you can!