Originally Posted by mjy
var x = 5;
/* displays 5: */
/* also displays 5: */
/* y has NOT been declared, i.e. it doesn't exist: */
/* just displays "undefined": */
/* causes a runtime error: */
Thanks, this works as it just passes in 'undefined', although they still want me to try and make it more generic I think, (passing in just the name).
As for the !ButtonObject, they want to make it modular and generic, while also teaching me JS so I can't do that.
As for the try catch, they don't use any in the gigantic enterprise app that this is, I guess the mindset is you shouldnt have any errors what so ever to be caught..ever.
and again for doing window[buttonobject] not sure how that works as I haven;t tried it out, but they want a method made for it.