function tellMeWhenDone(callback) {
  var a = 1000;
  var b = 2000;
  //當結束時呼叫另一個函數
  callback();
}

tellMeWhenDone(function() {
  console.log('做完了!');
})

tellMeWhenDone(function() {
  console.log('我還在做');
})

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.