I am aware that functions are conventionally expressed in camel case ie
function myFunctionName(){
return false;
}
and constructors with the first letter capitalized ie
function Person(name){
this.name = name;
}
But why is the JSON spelt in all capitals like in the function:
JSON.stringify(someValue);
I know it may be a bit of a pointless question but I can't seem to find the answer online.
Thanks
I am aware that functions are conventionally expressed in camel case ie
function myFunctionName(){
return false;
}
and constructors with the first letter capitalized ie
function Person(name){
this.name = name;
}
But why is the JSON spelt in all capitals like in the function:
JSON.stringify(someValue);
I know it may be a bit of a pointless question but I can't seem to find the answer online.
Thanks
Share Improve this question asked May 12, 2015 at 6:54 lukejkwlukejkw 1,13414 silver badges20 bronze badges 3- first of all JSON is not a function, it is an object. and JSON is an acronym. – syms Commented May 12, 2015 at 6:56
- Why isn't HTML all lowercase? – Salman Arshad Commented May 12, 2015 at 7:22
- I understand that JSON stands for JavaScript Object Notation but my question was why it was written in all uppercase. The way objects or variables are written often have a meaning as to why. An example off my head in C# would be how constants are written public const MY_CONSTANT = "constant value";@SalmanA – lukejkw Commented Jul 8, 2015 at 11:22
1 Answer
Reset to default 10This is because it is an acronym for JavaScript Object Notation.
In general, acronym conventions for JS seem less-defined / less-followed than other aspects. E.g., LabKey guidelines would classify this as a four-letter acronym requiring regular JS rules.