Skip to content

Instantly share code, notes, and snippets.

@thorsummoner
Created March 16, 2017 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thorsummoner/e860205ce9522aeb6a4717aba71b2e53 to your computer and use it in GitHub Desktop.
Save thorsummoner/e860205ce9522aeb6a4717aba71b2e53 to your computer and use it in GitHub Desktop.
my_hello = 'Hello!'
my_world = {
'antartica': 'cold',
}
anonymous_callback = function (injected1, injected2, param1, param2) {
param1 = param1 ? param1 : 'One';
param2 = param2 ? param2 : 'Two';
console.log('param1: (' + typeof(param1) + ') ' + param1)
console.log('param2: (' + typeof(param2) + ') ' + param2)
console.log('injected1: (' + typeof(injected1) + ') ' + injected1)
console.log('injected2: (' + typeof(injected2) + ') ' + injected2)
console.log(injected2)
}.bind(this, my_hello, my_world)
anonymous_callback('Param 1', 'Param 2')
"
param1: (string) Param 1
param2: (string) Param 2
injected1: (string) Hello!
injected2: (object) [object Object]
{ antartica: 'cold' }
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment