Skip to content

mazayastudio/eloquent-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Chapter 2- Program Structure

Expressions and Statements

  1. A fragment of code that produces a value is called an expression.
  2. Every value that is written literally is called an Expression. For example:
22
"Saturday"
  1. An expression between parentheses is also an expression.

The simplest kind of statements is an expression with a semicolon after it.

1;
true;

Bindings

To catch and hold values, JavaScript provides a thing called a binding or variable

let caught = 5 * 5;
console.log(caught);
// -> 10

The = operator can be used anytime to change values from the bindings. Imagine Bindings or Variables is a tentacle not Boxes. They do not contained values but they grasp them. Example:

let sayudhaDebt = 20;
sayudhaDebt = sayudhaDebt - 5;
console.log(sayudhaDebt);
// -> 15;

if a variable or binding has no value, you'll get the value undefined

About

My Notes while finishing Eloquent JavaScript Books

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published