Skip to content

Instantly share code, notes, and snippets.

@indongyoo
Created April 3, 2018 12:32
Show Gist options
  • Save indongyoo/1110c6c0132f161ed0d647aedef1d851 to your computer and use it in GitHub Desktop.
Save indongyoo/1110c6c0132f161ed0d647aedef1d851 to your computer and use it in GitHub Desktop.
go([0, 0, 3000, 5000, 6000, 1000, 5000],
someC(a => new Promise(function (resolve) {
setTimeout(function() { resolve(a); }, a);
})),
b => console.log(b, '<----------- 1초 뒤'));
// true <----------- 1초 뒤
// - 모든 값에 해당하는 함수 평가
// - 1000이 가장 먼저 결과를 만들어서 1초 뒤 결과를 즉시 리턴하고, 나머지는 기다리지 않음
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment