reading-notes

201 Entrance Exam Review

Functions

Function Declaration

function myFunction(parameters) {
  // code to run when function is called
}

Function Expression

let myFunction = function () {
  // code to run when function is called
}

Function Invoke

myFunction() // calls myFunction

Loops

For Loops

for (initial value; condition to evaluate; increment) {
  //code to be executed
}

While Loop

while (condition that MUST evaluate to true) {
  // code to be executed
}

Terminal Commands

Command Meaning Action
pwd Print Working Directory Tells you current PATH
cd Change Directory Moves to specified directory
mkdir Make Directory Makes new directory in specified location
touch Create File Makes a new file in specified location
ls List Contents List visible contents in a directory
ls -a List All Contents List all contents in a directory
ls -l List Contents, Long List Lists contents in a directory as a list, top to bottom

Clarifications