最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Why is JSON all uppercase - Stack Overflow

programmeradmin2浏览0评论

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
Add a ment  | 

1 Answer 1

Reset to default 10

This 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.

发布评论

评论列表(0)

  1. 暂无评论