showing results for - "simple callback pattern"
Davide
13 Feb 2016
1const add = (a, b, callback) => {
2  setTimeout(() => {
3    callback(a + b)
4  }, 2000)
5}
6
7add(2, 3, (sum) => {
8  console.log(sum) // should output 5 after 2 seconds
9})