js pass callback function as parameter code example
Example 1: javascript pass this to callback
makeHTTPRequest('GET', 'http://youramazingapi/money_makers.php').then(function(data){
this.shakeThose.push(data);
}.bind(this));
Example 2: how to pass callback function in javascript
function functionOne(x) { alert(x); }
function functionTwo(var1, callback) {
callback(var1);
}
functionTwo(2, functionOne);