There is a standard in the uppercase namespace for Javascript

I accept big mish-mash Javascript / jQuery code. I would like to move it to Backbone.js, but as an intermediary I try to skip it so that it is more modular.

I am wondering if there is a standard for namespaces for Javascript. I was going to do something like this:

var arc={
  name:"Spock",

  nav:function(){
    //alert('name' + this.name);
    obj=get_nav_obj();
    get_to_api_v2(obj);
  }

};

Should it be capitalized? I tend to see capital letters, but since the rest of the site is in Ruby, the lowercase letter may be more consistent.

THX

+5
source share
3 answers

javascript camelCase . CAPSLOCKS "" . ProperCase (, new).

+7

capilization Javascript . , javascript, . , . arc - , , , .

+3

. , . .

Do a google search for “javascript code guidleine” and see what others do

+2
source

All Articles