Can I add any random attribute to \'window\' object in javascript? Some thing like:
window.my_own_attr = \"my_value\"
Does it have any side
Yes, you can, but in general you shouldn't.
The window object is also the JS default "global" object, so all global variables get added there.
You're unlikely to break anything unless you overwrite a property that's already there, but it's considered bad practise to dump variables on window, or otherwise create lots of global variables.