What is the best-practice casing style for javascript? Why?

前端 未结 6 1922
梦毁少年i
梦毁少年i 2020-12-09 09:19

One aspect of javascript that it\'s hard to find information on is casing practices. By casing practices, I mean what casing style (ie. camel-case, pascal-case, etc) should

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-09 09:37

    I prefer PascalCase for constructors and camelCase for everything else. That's the style that JS standard library uses and well... every JS framework I've seen so far :)

    And I use all_lowercase naming convention for all files served from web. There are some case-insensitive file systems out there.

提交回复
热议问题