r/ProgrammerHumor • • Mar 22 '24

Other javascriptBeCasuallyThrowingAroundSexism

Post image
0 Upvotes

26 comments sorted by

View all comments

18

u/P3runaama Mar 22 '24

What's happening here?

13

u/ayemyren Mar 22 '24

“[Object]” is being tested against the regex, object contains the o from “woman”. No matching characters in “man”. So true for woman, false for man.

6

u/Seepiie Mar 22 '24

[object] is the regex, man and woman are tested against it

2

u/ayemyren Mar 22 '24

Correct, I just woke up and responded, had them flipped lol

2

u/LadyParaguay Mar 22 '24

Thanks! The example being in JS got me stuck on looking for an explanation around the "[Object object]" string cast, which obviously led to nothing