Basic Javascript Guide

Overview


Expressions


An expression is piece of text within a program that (possibly) evaluates to some other value. For instance, the text "2+2" evaluates to the number "4". Technically, when we assign a value to a variable, you assign an expression to the variable name, and the expression is evaluated prior to the assignment. The following code demonstrates assigning the value of 2+2 to the variable "value".


let value = 2+2;
            


In this case, the expression "2+2" is evaluated to 4 before assigned to the variable "value".

Contents