MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1bjjkm6/arejsdevsactuallysane/kvug4wh/
r/ProgrammerHumor • u/jarulsamy • Mar 20 '24
554 comments sorted by
View all comments
Show parent comment
4
No, strings are strings
Strings are object prototypes.
Object.getPrototypeOf("foobar") // String {'', anchor: ƒ, at: ƒ, big: ƒ, blink: ƒ, …} "foobar".__proto__ // String {'', anchor: ƒ, at: ƒ, big: ƒ, blink: ƒ, …}
Also from the Mozilla docs:
String
The String object is used to represent and manipulate a sequence of characters.
1 u/intbeam Mar 21 '24 Strings are strings, what you are seeing is an API wrapper, not object orientationMozilla and everyone else should stop gaslighting people into making the mistake of believing that JS is an object oriented language 1 u/badmonkey0001 Red security clearance Mar 21 '24 I'm not saying JS is any good for OO or evangelizing anything else about it. JS is a weird monster. It plays loose with nearly all programming concepts.
1
Strings are strings, what you are seeing is an API wrapper, not object orientation
Mozilla and everyone else should stop gaslighting people into making the mistake of believing that JS is an object oriented language
1 u/badmonkey0001 Red security clearance Mar 21 '24 I'm not saying JS is any good for OO or evangelizing anything else about it. JS is a weird monster. It plays loose with nearly all programming concepts.
I'm not saying JS is any good for OO or evangelizing anything else about it. JS is a weird monster. It plays loose with nearly all programming concepts.
View all comments
Show parent comment
4
u/badmonkey0001 Red security clearance Mar 21 '24
Strings are object prototypes.
Also from the Mozilla docs: