• 0 Posts
  • 107 Comments
Joined 8 months ago
cake
Cake day: November 14th, 2023

help-circle




  • You could’ve tried it yourself in the time it took you to craft this reply.

    God I hate it when people have no social skills and talk like this.

    How the f— do you know the circumstances of the person you’re talking to? Maybe they don’t have a computer at hand.

    Don’t you realize how snotty and bratty and annoying this sounds, regardless?

    Bah.





  • On Android, use Share image from Firefox or similar, then click the edit icon before sharing (on the share sheet that pops up), then just immediately share without modifications. It’ll share it as a new PNG I’m pretty sure. Dang Facebook Messenger that won’t accept WebP and I have to do this so many times.









  • Victor@lemmy.worldtoProgrammer Humor@programming.devJavaScript
    link
    fedilink
    arrow-up
    38
    arrow-down
    1
    ·
    edit-2
    7 days ago

    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.