Fundamentals

Information on this page give you basic knowlege to work with JavaScript.

You will learn

  • What is variable
  • What is value

A variable is like a container for a value, like a number we might use in a sum, or a string that we might use as part of a sentence.

// 🔴 Never (almost never) define a variable "var"! // use "const" and if you will redeclare it later use "let"! const firstName = 'Dom'; const $nameLength = 3; const _myFirstJob = "Coder"; const SOME_AWESOME_CONSTANT = 42;

Variable name conventions

Camel Case —> someAwesomeVar

Deep Dive

Variable naming all the way down

By convention for JavaScript you should use:

Camel case for variables and methods. Pascal case for types and classes in JavaScript. Upper case snake case for constants.

Quick Comparison Table

Case TypeExample
Camel CasesomeAwesomeVar
Snake Casesome_awesome_var
Kebab Casesome-awesome-var
Pascal CaseSomeAwesomeVar
Upper Case Snake CaseSOME_AWESOME_VAR

If you interesting to learn more read article: Most Common Programming Case Types