console.log('main-1')function foo(param){ var p = new Promise(function(resolve, reject) { console.log('promise-1') if (param === 1) { resolve('1') } else { reject('2') } console.log('promise-2') }) return p }console.log('main-2') foo(1).then(function(value) { console.log('then-1') })console.log('main-3')
大话西游666
相关分类