K
K
kotepdag2020-03-12 10:18:59
JavaScript
kotepdag, 2020-03-12 10:18:59

Where to use camelCase and where snake_case?

Can you please tell me where and when to use each style?
For example, in JS I know this:
for constants known at the time of description: For constants calculated: But in general, if there is no style guide in the project, or the project is new, how to understand which and where to use the style?
const SNAKE_LENGTH = 12.5;
const windowHeight = window.outerHeight();

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Zagaevsky, 2020-03-12
@zagayevskiy

There must be style guides. If they are not there, take the popular ones for your language, they are always there.

R
Roman, 2020-03-12
@myjcom

https://github.com/rwaldron/idiomatic.js/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question