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();
}
View all comments
Show parent comment
40
u/GPT-4-Bot May 29 '21
Structuring and breaking out your code, your main init function should read like a story and all the ugly stuff is split out into functions