Ajax asynchrony

  node.js, question

There is a requirement that the page has several buttons, and clicking any button will send ajax once. If clicking two buttons, the data returned by the two ajax will be intersected. Is there any other way to ensure that the intersection must be called after ajax returns the data besides using synchronous ajax?

The code is similar to this:

//in getData, send ajax request
 var list1 = getData();
 var list2 = getData();
 // intersect is a self-written method to find the intersection. inter is the intersection of list1 and list2.
 var inter = intersect(list1,list2)

In addition to jquery’s defrred, use native methods. Please provide an idea