- var d1 = $.Deferred();
- var d2 = $.Deferred();
- $.when( d1, d2 ).done(function ( v1, v2 ) {
- console.log( v1 ); // "Fish"
- console.log( v2 ); // "Pizza"
- });
- d1.resolve( "Fish" );
- d2.resolve( "Pizza" );
Sequential using jquery ?
Please check this code . Its run.
- var d1 = $.Deferred();
- var d2 = $.Deferred();
- $.when( d1, d2 ).done(function ( v1, v2 ) {
- console.log( v2 ); // "Pizza"
- console.log( v1 ); // "Fish"
- });
- d1.resolve( "Fish" );
- d2.resolve( "Pizza" );
I will change console.log(v1); My output pizaa , fish
But i want to output same , for eg -fish and pizaa . How it's possible. Please solve this

Jaimin ShethiyaRank #177 · 13.7K reputationPosted Oct 10, 2019, 3:40 AM EDT
If you ahve changed the console statement then also you have to change the resolve statement then you have to achieve same output.
below is the code, can you please check that and let me know it's working or not for you.
Thanks
Sourabh DhimanRank #4,768 · 326 reputationPosted Oct 10, 2019, 4:37 AM EDT