MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/igvny1/python_goes_brrrr/g2xiv9e
r/ProgrammerHumor • u/das_freak • Aug 26 '20
789 comments sorted by
View all comments
Show parent comments
2
I tried this with class Foobar{}; console.log(""+new Foobar()) in Firefox dev console, but that just gave me [object Object]. So it might be the built-in type of the object.
class Foobar{}; console.log(""+new Foobar())
[object Object]
1 u/DeeSnow97 Aug 26 '20 It's actually an internal property that most JS classes don't modify, but there is a way to access it:class Testing {} Testing.prototype[Symbol.toStringTag] = "';DROP TABLE classes--" console.log("robert" + new Testing())This will log robert[object ';DROP TABLE classes--] to the console
1
It's actually an internal property that most JS classes don't modify, but there is a way to access it:
class Testing {} Testing.prototype[Symbol.toStringTag] = "';DROP TABLE classes--" console.log("robert" + new Testing())
This will log robert[object ';DROP TABLE classes--] to the console
robert[object ';DROP TABLE classes--]
2
u/[deleted] Aug 26 '20
I tried this with
class Foobar{}; console.log(""+new Foobar())in Firefox dev console, but that just gave me[object Object]. So it might be the built-in type of the object.