I'm new to javascript and I'm trying to figure out how to do something like this
SomeClass = {
confirm: function(){
if(!confirm('Sure?'))
{
return false;
}
},
someMethod: function(){
alert("OK");
}
}
And this is what I actually want to do
SomeClass.confirm().someMethod();
In fact i need to confirm an action just by adding .confirm() in front of the actual method. Is that even possible?