Answer the question
In order to leave comments, you need to log in
What is the smartest and best way to designate JS methods and properties?
Hello, what is the best way to write
let's say there is a say hi method
better than sayHi or say_hi?
I understand there is no difference, but how do professionals do it?
And let's say if the word is an abbreviation, then which is more correct
sayFBI (say_FBI) or sayFbi (say_fbi) The
question is interesting in terms of readability and speed of typing code
Answer the question
In order to leave comments, you need to log in
Properties and variables camel cas with a small letter. Classes - with big. If the method returns or sets a value, the name begins with get and set respectively: getValue(), setValue(val)).
Sometimes you can see the name of a class property starting with an underscore: _property - this is how private properties are usually denoted in OOP.
Constants in capital letters with underscores: SOME_CONSTANT_VALUE
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question