Ver Mensaje Individual
  #6 (permalink)  
Antiguo 23/05/2011, 16:46
Avatar de Aijoona
Aijoona
Colaborador
 
Fecha de Ingreso: mayo-2011
Ubicación: Buenos Aires
Mensajes: 779
Antigüedad: 12 años, 11 meses
Puntos: 343
Respuesta: crear una variable global

Bueno, ya que estoy bumpeo con un excelente post de @kangax al respecto:

http://perfectionkills.com/unnecessarily-comprehensive-look-into-a-rather-insignificant-issue-of-global-objects-creation/

Cita:
Undeclared assignments are historically considered a bad practice. They lead to confusion and increase the risk of global collisions. There are also certain browser bugs, such as that in IE (MSHTML DOM), where undeclared assignment results in an error if element with same id/name exists in the document. There’s a big chance for beginner to forget var and end up creating an unwanted global property. Or simply consider var’less version to be similar to that with the var. Or not even know about having to use var — after all, plain assignment seems to work just fine.
__________________
blog | @aijoona