passing blocks around in javascript without lengthy function syntax -



passing blocks around in javascript without lengthy function syntax -

in testing code, i'm getting lot of things this:

test.truth(function(){return mytest.isdef('')});

where bulk of line there function boilerplate. there way cut down that, can have syntax more like:

test.truth { mytest.isdef('') }

as 1 in scala?

of course, ideally highly browser compatible.

no, sorry. javascript has array literals - [] , object literals - {}, function literals possible using function() { } syntax

javascript

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -