Excuse me, but that's what you call elegant?
From a readability standpoint I'll take the "old" version any day:
function getFromDB(foo) {
var result = asynchronousCache.get("id:3244");
if ( null == result ) {
result = asynchronousDB.query("SELECT * from something WHERE id = 3244");
}
return result;
}
Also the first example, the cache hitting and missing, could be rewritten with async, too.