JavaScript Values:

There are two categories of values:
a.Primitive Values
b.Objects and Functions

Primitive Value: Primitive Values are numbers and strings, among other things. There’s nothing I can do in my code that would affect them.
The Primitive Values are highlighted below,

1.Undefined(undefined),used for unintentionally missing values.

2.Null​ (null), used for intentionally missing values.

3.Booleans​ (true and false), used for logical operations.

4.Numbers​ (-100, 3.14, and others), used for math calculations.

5.Strings​ (“hello”, “abracadabra”, and others), used for text.

6.Symbols​ (uncommon), used to hide implementation details.

7.Bigtits​ (uncommon and new), used for math on big numbers.

Objects and Functions: Objects and Functions​ are also values, but they are not primitive. This makes them very special.

1.Objects​ ({} and others), used to group related data and code.

2.Functions​ (x => x * 2 and others), used to refer to code.

There are two categories of values: there are ​Primitive Values​, and
then there are ​Objects and Functions​.​ In total, there are nine separate
types. Each type serves a specific purpose, but some are rarely used.

Coding Style

javaScript Coding Style

Our code must be as clean and easy to read as possible.

That is actually the art of programming — to take a complex task and code it in a way that is both correct and human-readable. A good code style greatly assists in that.

Here is a list with some suggested rules:

  1. A space between parameters.

2.Curly brace { on the same line after space.

3.Spaces around operators.

4.A semicolon ( ; ) is mandatory.

5.Lines are not very long.

6. } else { without a line break

7. Spaces around a nested call.

8. An empty line between logical blocks.

9. A space after for/if/while...

Nothing is set in stone here. These are style preferences, not religious dogmas.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store