I'm wondering what is the best way to access the obj variable in this example:
function Module() {
$('foo').on('click', function() {
if (obj.test === true) {
// do something
}
})
return {
setObj: function(obj) {
// what should I do
}
}
}
Is there a simple way to access obj in the click handler. I'm looking for the simplest way possible.