3 ms·
That's not completely true— location.replace() and location.assign() do slightly different things. But, yeah, this is basically 535 different ways to spell loca
by Cushman 15y ago
That'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.