State concept applied to Javascript object oriented architecture.