JavaScript

JavaScript Variables

My main goal for the new year is to master JavaScript. I am in the middle of the FreeCodeCamp course and decided to start over with basic JavaScript. I was more concerned with completing each challenge than grasping each concept. Going forward I have to slow down, take and review my notes daily. This weekend I worked with variables. Below is a simple explanation of JavaScript variables.

With JavaScript, there are several data types:

Undefined
Null
Boolean
String
Symbol
Number
Objects

Variables are like boxes that hold data.

Data is placed in boxes (variables). You refer to the data by naming the box (variable). Variables are declared by using the keyword var, the variable name, and a semicolon.

var myVariable;

Newly declared variables are undefined.

var myVariable = 2;
//Initializing a variable gives it an initial value.

Variables are written in camel case. The first word of the variable is lowercase and the first letter of the second and subsequent words are capitalized.

myVariable
myVariableNameIsLong

2 Comments

  • Jared

    I also stalled out on FCC and had to revisit a little bit. If you’re not averse to spending a little money (about $11), I also highly recommend Colt Steele’s Web Developer Bootcamp on Udemy: https://www.udemy.com/the-web-developer-bootcamp/

    I am just over halfway through it, and it’s incredibly thorough and he does a great job explaining everything. It covers everything from basic frontend to server-side backend coding. I’ve been alternating between that and FCC; there’s some overlap, but ultimately they complement one another well. (And that’s not an affiliate link or anything, I have just legitimately been enjoying the course and wanted to share!)

    Looking forward to following your progress.

    • Daphnie

      I love Udemy courses. I have heard nothing but good reviews about the course. I will check it out after my Bootstrap course.

      For me, using one resource doesn’t work. It is good to mix it up. I use courses, tutorials, side projects and other people.

Leave a Reply

%d bloggers like this: