I have the next chain of ajax calls:

```
ajaxCall1().then(function(){
ajaxCall2(). then(function(){
ajaxCall3().then(function(){
....
})
})
})
```

As you can see I am not returning the ajax calls but its just work fine. The next way is what I have seen as examples:

```
ajaxCall1()
.then(function(){
return ajaxCall2()
})
.then(function(){
return ajaxCall3()
}).then(function(){
....
})
```

What would be the right way?

Thanks

Answer:1

The first pattern is actually a well-known promise anti-pattern.

The chainability of promises allows us to get away from nesting callbacks and maintain a vertical structure.

Answer:2

need help with little thing. I've searched current question, but didn't find good example. I have two arrays with same count of objects: array1 = [{ id: 1, name: 'Johnny'}, { id: 2, name: 'Mike'}]; ...

need help with little thing. I've searched current question, but didn't find good example. I have two arrays with same count of objects: array1 = [{ id: 1, name: 'Johnny'}, { id: 2, name: 'Mike'}]; ...

- concat arrays into
- merging two arrays into one
- append into arrays

This function works on loading an external page inside of a div that passes a $_POST variable and click works on the first record on loading the same external page with $_POST variable from query. $(...

This function works on loading an external page inside of a div that passes a $_POST variable and click works on the first record on loading the same external page with $_POST variable from query. $(...

In my Vue-driven HTML I have the line <span>Last updated on {{incident.LastUpdate[0].date}}</span> data in the Vue instance is defined as data: { incident: {} } In the course of ...

In my Vue-driven HTML I have the line <span>Last updated on {{incident.LastUpdate[0].date}}</span> data in the Vue instance is defined as data: { incident: {} } In the course of ...

Suppose I have an array like this: var arr = []; arr["india"] = 7; arr["indonesia"] = 3; arr["usa"] = 1; [india: 7, indonesia: 3, usa: 1] I need to get an array like [india: (7/11*100), ...

Suppose I have an array like this: var arr = []; arr["india"] = 7; arr["indonesia"] = 3; arr["usa"] = 1; [india: 7, indonesia: 3, usa: 1] I need to get an array like [india: (7/11*100), ...

- calculate percentage from 2 numbers
- calculate percentage from two numbers
- calculate percentage from fraction
- calculate percentage from z score
- calculate percentage from total
- calculate percentage from ratio
- calculate percentage from number
- calculate percentage from decimal
- calculate percentage from pivot table
- calculate percentage from price
- calculate percentage from points
- calculate percentage from histogram
- calculate percentage from odds ratio
- calculate percentage from percentile
- calculate percentage from two numbers excel
- calculate percentage from mean and standard deviation
- calculate percentage from mg/ml
- calculate percentage from total amount
- calculate percentage from standard deviation
- calculate percentage from normal distribution