Send multiple arguments in .then function
NickName:hardy Ask DateTime:2017-04-29T21:28:52

Send multiple arguments in .then function

In callbacks we can send as many arguments as we want.

Likewise, I want to pass multiple arguments to a then function, either in Bluebird promises or native JavaScript promises.

Like this:

myPromise.then(a => {
    var b=122;
    // here I want to return multiple arguments
}).then((a,b,c) => {
    // do something with arguments
});

Copyright Notice:Content Author:「hardy」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/43696257/send-multiple-arguments-in-then-function

More about “Send multiple arguments in .then function” related questions

Send multiple arguments in .then function

In callbacks we can send as many arguments as we want. Likewise, I want to pass multiple arguments to a then function, either in Bluebird promises or native JavaScript promises. Like this: myPro...

Show Detail

How to send array to function as multiple arguments?

In Javascript I have simple test code: function x(a, b) { alert(a); alert(b); } var c = [1,2]; x(c); which send an argument c to function x() as one argument, assigned to a and b stays undef...

Show Detail

send multiple arguments using apply function

Hi I'm trying to use apply on a matrix I call eq; What I like to do is to send a function I made with multiple arguments. Currently when I do this it works: apply(eq, 1, manydo2) manydo2 <-

Show Detail

Send multiple arguments to the compute function in Flutter

I was trying to use the compute function in Flutter. void _blockPressHandler(int row, int col) async { // Called when user clicks any block on the sudoku board . row and col are the correspondi...

Show Detail

Send multiple dynamic arguments to jquery event functions

I want to send multiple arguments to JQUERY event functions.For sending one data i put it in value attr in html code. <li id="<?php echo 'v'.$value['vehicleid'] ?>" value="<?php ech

Show Detail

PHP send additional (optional) arguments through function arguments

Let's say I want to send the effect through a function argument, can I also send the additional arguments through that as well, can't really explain it, here is how I would imagine it. <?php /...

Show Detail

function with multiple arguments

how to pass multiple arguments in a single function in Objective-C? I want to pass 2 integer values and the return value is also integer. I want to use the new Objective-C syntax, not the old C/C++

Show Detail

Is it possible to send a variable number of arguments to a JavaScript function?

Is it possible to send a variable number of arguments to a JavaScript function, from an array? var arr = ['a','b','c'] var func = function() { // debug alert(arguments.length);

Show Detail

Is it possible to send a variable number of arguments to a JavaScript function?

Is it possible to send a variable number of arguments to a JavaScript function, from an array? var arr = ['a','b','c'] var func = function() { // debug alert(arguments.length);

Show Detail

Is it possible to send a variable number of arguments to a JavaScript function?

Is it possible to send a variable number of arguments to a JavaScript function, from an array? var arr = ['a','b','c'] var func = function() { // debug alert(arguments.length);

Show Detail