WordPress AJAX – how to return true or false in the callback function

this would work to:

function my_callback() {
    if(something()) {
        echo 1;
    }
    exit; //no text sent or even exit('0'); will work
}

and in js:

var response = do_ajax();
if(response){
    //do stuff
}