|
Object 'Exists' function
I am tasked with making a function that can accept many different items and return whether or not they exist.
Currently I am struggling on seeing if an object that holds all the methods for a button exists. I thought I could pass in the string name of the object then do a $('buttonObject').length >0 in the 'Exists' method to see if it was created yet. However this will never return true, and I cannot pass in the object into my exists function without it being created yet (throws error). So something like Exists(buttonObject) won't work, I'll have to pass in the string name of it (Exists('buttonObject')) or something else (I'm new to JS).
So how do I go about testing whether or not it exists if I cannot pass in buttonObject, without quotes?
|