function createPromise(resolveSeconds, rejectSeconds) {
    return new Promise(function (resolve, reject) {
        setTimeout(function () { return resolve('promise is resolved'); }, resolveSeconds * 1e3);
        setTimeout(function () { return reject('promise is rejected'); }, rejectSeconds * 1e3);
    });
}
/**
 * Promise example
 * Create a Promise and check it's features
 */
Promise example
Create a Promise and check it's features
Promise example Create a Promise and check it ' s features
function createPromise(resolveSeconds, rejectSeconds) {
    return new Promise(function (resolve, reject) {
        setTimeout(function () { return resolve('promise is resolved'); }, resolveSeconds * 1e3);
        setTimeout(function () { return reject('promise is rejected'); }, rejectSeconds * 1e3);
    });
}
function createPromise ( resolveSeconds , rejectSeconds ) { return new Promise ( function ( resolve , reject ) { setTimeout ( function ( ) { return resolve ( 'promise is resolved' ) ; } , resolveSeconds * 1e3 ) ; setTimeout ( function ( ) { return reject ( 'promise is rejected' ) ; } , rejectSeconds * 1e3 ) ; } ) ; }
Promise example
 Create a Promise and check it's features
Promise example Create a Promise and check it ' s features