Skip to content

Instantly share code, notes, and snippets.

View kyosuke's full-sized avatar

Kyosuke Nakamura kyosuke

View GitHub Profile
@kyosuke
kyosuke / promise.js
Last active October 3, 2016 14:04
直列Promise
console.log('start')
var array = [1,2,3];
array.reduce((acc, current)=>{
return acc.then(() => wait(current))
}, Promise.resolve())
function wait (x) {
return new Promise((resolve) => {
(function($){
$(function(){
$.support.fixedPosition = (function(){
var container = document.body;
if (document.createElement && container && container.appendChild && container.removeChild) {
var el = document.createElement('div');
if (!el.getBoundingClientRect) return null;