JavaScript Fundamentals

RMAG news

Here are some of the basic fundamentals and concepts of JavaScript I have learned so far.

Everything within JavaScript is a form of data type except for the common operators and symbols (+,%,!,etc.)
There are seven basic data types

Numbers
Strings
Booleans
Objects
Arrays
Null
Undefined

I will do another post tomorrow going more in depth into the different data types but for now this is just a list of the seven basic type names.

These data types are used and combined to make up Variables. Variables are declared with LET, CONST, or VAR.

LET allows for a variable to be declared and assigned, but also allows for the variables value to be re-assigned later on in case it needs an update.
CONST is used when we want to declare a variable and assign a permanent value to it.
VAR is honestly rarely used since it can affect global scope.

Variables and their values are used to create expressions within JavaScript to create code blocks and functions.

The use of Variables essentially allows for less cluttered code and condensed expressions. If we were to assign the value of the entire Alphabet (“a,b,c,d…”) to the variable name fullAlphabet, we could then call on the variable instead of having to type the entire thing.

Naming Variables:
-use camel Case ( every word after the first is capitalized) Ex: joesVariable, testVariableName, willyWonka, oneTwoThreeFour, etc.
-use underscores instead of spaces when naming Ex: joes_variable, one_two_three_four, you_also_dont_have_to_capitalize_in_this_format_but_you_can,
-Do not start Variable names with $ it can lead to conflicts with many JavaScript library names.

These are the first few basic steps of learning to write code. Tomorrow I will post going more in depth on the different data types and their applicable methods. I will also explain Interpolation and its use.

“Do you wish me a good morning, or mean that it is a good morning whether I want it or not; or that you feel good this morning; or that it is a morning to be good on?” – Gandalf the Grey

Please follow and like us:
Pin Share