Javascript: coding standards, Pascal corpus or Camel corpus?
I am making a function call and passing on an array of objects, but I am not sure whether to use CamingCasing or PascalCasing. Here is my method
util.load({
DefaultText:'Empty',
Items:[
{
Id:0,
Title:'Press'
}
]
});
If you notice that I was going through DefaulText, but should it be defaultText? and also the elements, should they be? and inside Items, and I also pass the Id and Title.
Can anyone confirm the correct way to do this?
I know the methods are camelCasing, but are they passed in objects like above?
Thank you in advance
source to share
The most popular JavaScript convention is to use PascalCasing, since you call it on constructors (classes) like String, Number, Date and camel casing for variable names and object keys. This code convention is used for all built-in JavaScript functionality in modern browsers, so I would recommend using it for your own code as well.
source to share