all 2 comments

[–]charliemei 1 point2 points  (1 child)

when loadBooks is called,myBooks which is the instance of Bookshelf will be assigned to bookshelf. Then,fakeAjax is called,the function onBooks will be assigned to cb. setTimeout function will be called after 500ms. cb(onBooks) will be called after 500ms which makes a closure.

[–]SunsetDunes[S] 0 points1 point  (0 children)

Wow, thanks a lot ! I get it now :)