Skip to content
Patricia Kruep edited this page Mar 9, 2015 · 2 revisions

Glossary

A collection of terms and their definitions encountered during the workshop.

JavaScript

Statement

  • A statement is a complete instruction for the browser/UA to complete.
  • The end of a statement is marked with a semicolon.
  • The semicolon is part of the JS language syntax.
  • Syntax is the set of rules that describe how a language is written.

Expression

Code block

  • Code blocks are defined by a pair of curly braces. Statements listed between open and closed curly braces.

Operator

  • Operators are symbols or keywords JS uses to evaluate or manipulate data. We’ll take a closer look at operators later.
  • Assignment operator
    • The = sign, roughly in the middle of the statement, is called the ‘assignment operator’
    • The assignment operator is one of many operators in the JS language, also part of the syntax

Case sensitivity

White space

Comment

Literal

String

  • Strings are one of three primitive data types in JS. Numbers and booleans (true/false) are the other two.
  • Strings are characters captured between a pair of double quotes or a pair of single quotes.
    • Like letter beads strung on a string.
  • They’re sort of like atoms or “primary” colors. The primitive data types can’t be made from anything else.

Variable

  • A variable is a means of storing a piece of data in memory and giving it a name so we can refer to it elsewhere in the program.
  • The var keyword tells JS that we are creating a variable. We declare the variable to JS.
  • The variable name is a unique identifier with some syntax rules.
    • a-z, A-Z, 0-9
    • _, $ allowed
    • dashes not appreciated
    • First character must be a letter or $
    • Case sensitive
  • Where ever we need the data in the variable, we insert the variable name.

Constant

Identifier

Semicolon (;)

API

Document Object Model

Loop

Branch

Function

  • A function is a block of code written once and stored in memory while the program is running.
    • Functions are declared using the function keyword, frequently followed by the name of the function.
      • Naming rules same as for variables
    • Functions can receive data values for use within the function and can return data back to where the function was called.
    • Code blocks are defined by a pair of curly braces. Statements listed between open and closed curly braces.

Event

  • An event is an action, usually triggered by the user: mouse click, key press, focus on a link or form element, loading a page.

Event handler

  • An event handler is an instruction to JS to ‘listen’ for a particular event to happen. JS has further instructions for what to do when it ‘hears’ the event happen.

Clone this wiki locally