Creating functions in objects using javascript -


i came across following recently, seems object declaration, starting semi-colon. works fine.

;(function() { var ..... = this; })()

are there difference in declaring way or if there alternatives?

there lot of concepts you've got wrong.

  1. though functions objects too, isn't object declaration, it's normal function declaration.
  2. the functional form you've used self-invoking function.
  3. the semi-colon ; used code doesn't break when several scripts minified single file.

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -