工作中遇到的各种问题

eval


requireJS


h5 history  pjax


Promise.all()


Promise.all = function ( promises ) {
            return new Promise( function ( fulfil, reject ) {
                var result = [], pending, i, processPromise;

                if ( !promises.length ) {
                    fulfil( result );
                    return;
                }

                processPromise = function ( i ) {
                    promises[i].then( function ( value ) {
                        result[i] = value;

                        if ( !--pending ) {
                            fulfil( result );
                        }
                    }, reject );
                };

                pending = i = promises.length;
                while ( i-- ) {
                    processPromise( i );
                }
            });
        };

猜你喜欢

转载自blog.csdn.net/fortunegrant/article/details/82216869