View on GitHub

marymafa.github.io


layout: post title: controllers and states date: 2017-12-06 —

controllers and states

In information technology and computer science, a program is described as stateful if it is designed to remember preceding events or user interactions;[1] the remembered information is called the state of the system. Controller are gluess between models and viewes and also recieves events from viewes accordingly.

Module pattern The module parttern is great way t9o encapsucate logical and prevent global namespace population. It possible by aonymous functions, which are arguably by the single best reature of javascript.

Global import Variable definations inside the module are local, they can’t be accessed otside in the global namespaced. Global variable can be readily accssed and manipulated inside the module.

Global exporting The facrt that were using a variable called export to set any global variable means that code is clearer, making it obvioous which global variables a module is creeating .