4 ms·
I really see only two ways here: 1) one of hundreds of equivalent syntaxes for the AST that assigns to location, and 2) location.reload() So if we're going t
by Animus7 15y ago
I really see only two ways here:
1) one of hundreds of equivalent syntaxes for the AST that assigns to location, and
2) location.reload()
So if we're going to play this game and these count as different, why not encode the identifiers in hex notation? Or replace the identifiers with lambda calls to compute them? Or eval()?
Seems like if these 535 ways count, so should the other infinity of them.
- Cushman 15y agoThat's not completely true— location.replace() and location.assign() do slightly different things. But, yeah, this is basically 535 different ways to spell location = location. And not even very interesting ones. window.window is window, so you can just go nuts with the chaining. So is window.self, window.top, window.frames... window.self.top.frames.location = frames.top.self.window.location? Now we're talkin'.
- sjs 15y agoYeah, not very exciting. Once you go down that road you pass by window['l' + 'ocation'] on the way to window['loc' + (''+![])[!![]+![]] + (''+!![])[-![]] + 'ion'] and so on. I would have completed it but it's 2:30 and I'm tired.
- karl_nerd 15y agosorry to bother you sir but could you tell me what that is called and maybe where i find out more about it?
- karl_nerd 15y agook found this good old one http://news.ycombinator.com/item?id=2129745 http://news.ycombinator.com/item?id=2129745
- sjs 15y agol33t searching skills, I couldn't find it. That's where I learned this technique.
- jrockway 15y agoIt's called programming. You can learn about it by typing stuff into your computer and seeing what happens.
- pak 15y agoAha, indexing the characters out of "false" and "true"... clever.