-
Notifications
You must be signed in to change notification settings - Fork 0
Glossary
Patricia Kruep edited this page Mar 9, 2015
·
2 revisions
A collection of terms and their definitions encountered during the workshop.
- 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.
- Code blocks are defined by a pair of curly braces. Statements listed between open and closed curly braces.
- 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
- 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.
- 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.
- 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.
- Functions are declared using the function keyword, frequently followed by the name of the function.
- An event is an action, usually triggered by the user: mouse click, key press, focus on a link or form element, loading a page.
- 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.