How to call a function from a function argument in JavaScript?
<p>So I read the tutorial from some web, and they did something like this.</p>

<pre><code>function populateDB(tx) {
     tx.executeSql('DROP TABLE IF EXISTS DEMO');
     tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
     tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
     tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
}

function errorCB(err) {
    alert("Error processing SQL: "+err.code);
}

function successCB() {
    alert("success!");
}

var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
db.transaction(populateDB, errorCB, successCB);
</code></pre>

<p>In the last line, they called the method transaction from object db, and there are 3 functions in the argument field, but isn't the functions populateDB, errorCB both need an argument as well? Where is that argument being called?</p>
