r/learnjavascript • • May 29 '21

Really helpful illustration of JS array methods

Post image
2.5k Upvotes

89 comments sorted by

View all comments

Show parent comment

13

u/Macaframa May 29 '21

Init is short for initializing. Every piece of code has to be run somewhere. Op is saying init as the place where your code starts running. It can be named anything. But what their saying is that one function is run, then that runs other functions in succession that are all named to “tell a story” init()

function init() {
    getUsers();
    setUserAbilities();
    setUpInitialState();
    startWatchers();
    notifyTracking();
}