Is there a way in JavaScript to call a function without parentheses?
For example in jQuery:
$(\'#wrap\').text(\"asdf\"); will work and so will <
newYou can call a function using new. The twist is, within the function this becomes an object being constructed by the function instead of whatever it would normally be.
function test () { alert('it worked'); }
...
new test; // alerts "it worked"
call and applyYou can use call or apply to call a function indirectly. You'll still need parentheses (unless you use new), but you won't be directly invoking the function with parentheses.