Skip to content
DevMeme
6769 of 7435
Cat Furious That JavaScript String Comparison Makes Dog Greater Than Cat
Languages Post #7420, on Nov 15, 2025 in TG

Cat Furious That JavaScript String Comparison Makes Dog Greater Than Cat

Description

A meme with bold white text at the top reading 'HE IS MAD THAT "DOG" > "CAT" IS TRUE IN JAVASCRIPT'. Below is a code snippet showing 'console.log("Dog" > "Cat") //true'. The main image shows an angry-looking Scottish Fold cat sitting on a tiled floor next to an orange appliance, with a human hand reaching toward it offering a treat and the cat aggressively grabbing at it with a disgruntled expression. The cat's anger perfectly represents the frustration with JavaScript's lexicographic string comparison, where 'Dog' > 'Cat' evaluates to true because 'D' has a higher Unicode code point than 'C'. The imgflip watermark is visible in the bottom right

Comments

11
Anonymous ★ Top Pick In JavaScript, dogs are greater than cats. In TypeScript, the compiler would've stopped you from comparing pets in the first place
  1. Anonymous ★ Top Pick

    In JavaScript, dogs are greater than cats. In TypeScript, the compiler would've stopped you from comparing pets in the first place

  2. Anonymous

    Of course 'Dog' > 'Cat'. It's lexicographical order. The cat's not mad about that. It's mad because ('b' + 'a' + + 'a' + 'a').toLowerCase() is 'banana'

  3. @purplesyringa 7mo

    okay but why are we talking shit about JS when the exact same thing happens literally everywhere else

    1. @purplesyringa 7mo

      well okay not everywhere

      1. @nwordtech 7mo

        50% of the time it works all the time. Just don't update your binary

      2. _ 7mo

        It compares the pointers and it so happends that "Dog" is stored earlier in the executable than "Cat" ? Maybe try running with others optimization levels

        1. _ 7mo

          Actually the C standard made it UB to compare cats and dog that way3

        2. dev_meme 7mo

          Additionaly, even in a tiny program, the compiler uses its normal constant-pool layout rules, so literals aren’t stored in source order

  4. @anonusernametg 7mo

    Idk why but I love this cat sooo much

  5. _ 7mo

    But in a shell, cat > dog is valid while dog > cat is not

  6. @hyena_stuff 7mo

    Be gone spambot! @linegel

Use J and K for navigation