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

c# - Move local mssql database to webhosted MYSQL -

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -