Flashcards
Javascript
Cards in this deck (27)
- 1DATA TYPESnumber, string, Boolean, object, function, undefined
- 2WHICH NUMBERS OFFER PRECISE CALCULATIONS AND WHICH DON'Tprecise - integers
not precise - fractional numbers - 3NAME THE ARITMETIC OPERATIONSaddition, substraction, multiplication, division, remainder
- 4NAME THE SPECIAL NUMBERSpositive INFINITY
negative INFINITY
NaN - 5NAME THE CHARACTERS THAT NEED ESCAPING\\ backslash
\n newline
\t tab
\' single quote
\" double quote - 6WHAT ARE TEMPLATE LITERALSbacktick -quoted (`) strings, that can span lines or embed other values
`half of 100 is${100 / 2}`
- the text inside ${ } will be computed - 7NAME THE TYPES OF OPERATORSUNARY
- minus, typeof, delete
BINARY
- aritmetic operators (+ - * / %), comparison operators (<, <=, ==, !=, >=, >, ===, !==), logical operators (&&, ||) , "" in,
TERNARY
-conditional (true ? a : b) - 8WHICH TWO VALUES ARE EMPTY AND WHAT IS THE DIFFERENCE BETWEEN THEMnull - nothing
undefined - something that has not been assigned a value yet - 9WHAT DOES PROGRAM CONSIST OFexpressions groupped into statements
- 10WHAT DO FUNCTIONS PRODUCEvalues and side effects
- 11WHAT ARE BINDINGS AND WHAT IS THE DIFFERENCE BETWEEN THEIR KEYWORDS- things that hold values
- LET has block scope
VAR can have both local and global scope
CONST has a constant value and local scope - 12WHAT IS A FUNCTIONpiece of program wrapped in a value
- 13NAME BUILD-IN FUNCTIONSprompt
alert
console.log
confirm - 14NAME AND DEMONSTRATE LOOPSfor (var i = 0; i < 5; i++) { code }
var i = 0; while (i < 5) {code; i++}
var i = 0; do {code; i++} while (i < 5); - 15HOW CAN YOU GET OUT OF THE LOOPbreak; - ends the loop
continue; - continues from the next value - 16DEMONSTRATE A SWITCH STATEMENTlet day;
switch(day) {
case x:
code;
break;
default:
code;
} - 17DECLARE A FUNCTION IN THREE WAYS1: const x = function( ) {};
2: function x( ) {}
3: const x = (a, b) => { } - 18WHAT ARE PARAMETERS AND ARGUMENTS- parameters represent values function needs to work with
- arguments are the actual values the function uses when called - 19WHAT DETERMINES THE VALUE OF A FUNCTIONa return statement
- 20NAME TWO KINDS OF SCOPElocal - let, const
global - var - 21EXPLAIN THE DIFFERENCE BETWEEN FUNCTION NAME AND VALUE- value is a value as any other
- name (binding) can be assigned a new value - 22WHAT DO YOU CALL A FUNCTION THAT CALLS ITSELFrecursive
- 23NAME DATA STRUCTURESobject - collections of properties { }
array - list of values [ ] - 24ARRAY PROPERTIES.length
- 25STRING METHODS.toUpperCase( )
.toLowerCase( ) - 26ARRAY METHODS.push( )
.pop( ) - 27OBJECT METHODSObject.keys( ) - return property names as an array of strings
Object.assign( ) - copy the properties from one object to another
Information
- Description
- Questions based on the book Eloquent Javascript
- Created by
- Rachel Rohac
- Views
- 13
- Tags
- Rating