Secret
Secret

Reputation: 3358

Getting the return value of a lambda function?

function user_id( sessionID )
{
    db
        .where({ session_id: battleData })
        .get('vp_sessions', unserialize);
}

function unserialize(err, results, fields)
{
    var serialized = results[0];
    return PHPUnserialize.unserialize(serialized.user_data);    
}

Is it possible to return the the return value of unserialize?

Upvotes: 0

Views: 212

Answers (1)

Quentin
Quentin

Reputation: 943759

You can only get the return value of a function when you call it. None of the code you have provided calls it.

You pass it to the get method which may call it, but it is up to the code of the get method to do something with the return value.

Upvotes: 4

Related Questions