javascript - In ES6, how do you pass in extra arguments to a function inside a .then() call? -


if have following setup:

function entrypoint (somevariable) {    getvalue(arg)     .then(anotherfunction) }  function anotherfunction (arg1) { } 

how can make somevariable available in anotherfunction?

you try this.

function entrypoint (somevariable) {   getvalue(arg)     .then(anotherfunction(somevariable)) }  function anotherfunction(somevariable) {   return function(arg1) {   } } 

Comments