class User{
constructor(name,age){
this.name=name;
this.age=age;
}
showName(){
alert(this.n...阅读全文>>
//那个请求的快,返回的那个
Promise.race([
$.ajax({url:"js/data.json",dataType:'json'}),
$.ajax({url:"js/data2.json",dataType:'json'})
]).then(data=>{
console.log(data); //data只返回了data2.json里的东西
},error=>{
alert("失败了");
});
//所有的请求都返回
Promise.all([
$.ajax({url:"js/data.jso...阅读全文>>
es6书写连接数组阅读全文>>