Skip to content

Instantly share code, notes, and snippets.

View Xflofoxx's full-sized avatar

Dario Olivini Xflofoxx

View GitHub Profile
@Xflofoxx
Xflofoxx / backwards_function_definition.js
Created December 9, 2015 13:06
How to make the definition of a function compatible backwards
// Starting
function myFunction(paramA, callback){
console.log("I'm the old function with paramA and callback.");
callback(paramA);
}
// test
myFunction("1", function(a){console.log("I should be the parameter: "+a)});
// returns
// I'm the old function with paramA and callback.
// I should be the parameter: 10