Check out the following page.
You will get an alert, nothing existing. But then check out the code and figure out how it is done.
Have fun!
![]()
| SitePoint Sponsor |





Check out the following page.
You will get an alert, nothing existing. But then check out the code and figure out how it is done.
Have fun!
![]()



yeah that is weird, some one going to explain?
I need someone to protect me from
all the measures they take in order to protect me





nice joke![]()





So lets us know how the "joke" works![]()





"public", "Class" and other "keywords" there are actually labels and can be arbitrary identifiers (or just omitted). He could have written "foo: bar: " instead of "public: Class:" with exactly the same effect.




Hm, my code editor marks them down as syntax errors, starting at this line:
It makes sense, since Javascript object notation glues name/value pairs together with ":" instead of "=". How is it possible it still works then?Code:private: message = "",





The syntax is "property: value", where "value" is any expression, including assignment. For example, this
will create property "bar" equal to "123" and, as a side effect, assign 123 to the variable "quux".Code:foo = { bar: quux = 123 }





You rock stereofrog!
![]()
Bookmarks