this question is quite basic, Here is a sample code what I want to do in javascrtipt:
(function getdata(){
gettrue( true=true );
gettrue( 1==2 );
gettrue( 1==1 );
// write something here to get all three expressions result ?
// console.log( [ all three result ] )
})()
gettrue(){}
update:
This question can be used for a test framework:
test("several test result:" , function(){
assert("test1" , true );
assert("test2" , false )
})
function test(title , fn){
console.log("running: " + title)
fn()
// write something here to get all result of assert
// not more than 2 lines
}
function assert(str, test){
if(test){
console.log(str +" : PASS ")
}else{
console.log(str +" : Fail ")
}
return test
}
test( function(){ assert( true) ; assert(false) } );