Ricardo Ribas
1 min readApr 9, 2019

--

If you don’t want to pollute the scope with variables, would be cool to have it like the following snippet?

var windows = [];window.open = (function($window) {
var win = $window.apply(this, arguments);
windows.push(win);
return win;
})(window.open);

You can even extend it to the windows array.

--

--

Ricardo Ribas
Ricardo Ribas

Written by Ricardo Ribas

Software Engineer passionate about rock climbing, yoga, gaming and travelling

No responses yet