So there’s yet another level of quirkery to this bullshit then, it seems. 😆 Nice digging! 🤝
I also noticed that if you surround the curlies with parentheses, you get the same again:
> eval('{} + []')
0
> eval('({}) + []')
'[object Object]'
So there’s yet another level of quirkery to this bullshit then, it seems. 😆 Nice digging! 🤝
I also noticed that if you surround the curlies with parentheses, you get the same again:
> eval('{} + []')
0
> eval('({}) + []')
'[object Object]'
In node, I get the same result in both cases. "[object Object]"
It’s calling the toString()
method on both of them, which in the array case is the same as calling .join(",")
on the array. For an empty array, that results in an empty string added to "[object Object]"
at either end in the respective case in the picture.
Not sure how we’d get 0 though. Anybody know an implementation that does that? Browsers do that maybe? Which way is spec compliant? Number([])
is 0, and I think maybe it’s in the spec that the algorithm for type coercion includes an initial attempt to convert to Number before falling back to toString()
? I dunno, this is all off the top of my head.
If the projector supports apps, maybe it can run Plex/Jellyfin? Otherwise maybe I would have another small Pi or a small laptop or something that would use the projector as its output. I’m assuming the projector doesn’t support HDR so a regular browser connecting to Plex could work.
I just use my HDR-enabled smart TV to connect to Plex and Jellyfin. 🤷♂️
My future plans include setting up a NAS storage and connecting that to a Pi which would be always on. The Pi would be a torrent seeder, and a Plex/Jellyfin server as well.
This way my trusty desktop computer can rest after being on 24/7 for like 4 years now. Poor thing.
I haven’t tried this yet, so I can’t report on how well it works. But maybe it can serve as inspiration for you.
Yeah… Then again I just use the DuckDuckGo bang !mdn
and it searches MDN directly.
There’s also devdocs.io which can be indispensable when using a lot of popular utility libraries and frameworks in the same project. Just having a single page with all the relevant docs is just a real blessing.
I remember visiting W3S like 10-15 years ago when first learning DOM manipulation etc at uni. But nowadays there’s nothing it can give me that MDN can’t, that I need to know.
Learn JavaScript. It’s a pretty good language. 👍
MDN ftw, screw stackoverflow.
Thoroughly confusing lol. I think I need to check the spec in order to grasp this. I feel like this has more to do with the typing system rather than nil
itself, maybe. I’ll see.
But yeah, this is nothing like null
or undefined
in JS, but more similar to NaN
.
Thank you for trying to explain!
What I mean is that in JS you can’t do NaN != NaN
, not even variable != NaN
. So you’re not saying it’s the same in Go, since you can do a != nil
?
Good luck with that lol. Who would fall for that.
You’d first check for nil values
What does this mean, if not the same as
then compare like normal
?
Why would they do that? Talk about generating mistrust.
If nil ≠ nil, how do you compare a variable to the literal?
I think its type system is “okay”, I mean inherently dynamic typing is pretty error-prone. But its type coercion algorithms are bonkers. Also that whole “NaN ≠ NaN” business…
DuckDuckGo ain’t too bad either. 👍
Swedish: högtalare, “high talker”, pretty much “loudspeaker”.
https://duckduckgo.com/duckduckgo-help-pages/results/sources/
Not all results, but yes.
Give the Kakoune editor a try for native multi cursor editing. Or better yet, if you are a developer, the Helix editor.
I’m a web developer and transitioned quite seamlessly to the Helix editor from Visual Studio Code without much hassle.
The Helix editor is growing and gaining new functionality all the time.
I thought IIFE’s usually looked like
(function (...params) {})(...args)
. That’s not the latest way? To be honest I never used them much, at least not after arrow functions arrived.