JavaScript Types, Operators, Structures, and Functions

JavaScript Types, Operators, Structures, and Functions

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

Binary operator

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

1

All-time users

1

Favorites

0

Last updated

1 year ago

Date created

Mar 14, 2020

Cards (23)

Section 1

(23 cards)

Binary operator

Front

applies to 2 operands, num1 - num2

Back

Switch statement Syntax?

Front

Same logic as if statements switch(expression) { case value1: //statement break; }

Back

Arrow function syntax

Front

(param) => "returnValue" ;

Back

Local scope / function scope

Front

defined inside of a function

Back

Trinary operator

Front

applies to 3 operands //do y if true, z if false (condition) ? y : z

Back

JavaScript number type

Front

encompasses integer, long, double,

Back

==

Front

equality operator, converts to the same type before performing comparison

Back

=== or !==

Front

identity operator, returns true if both values and types are identical

Back

Anonymous Function constructor syntax

Front

new function("param1", "param2", "return a + b;");

Back

Global scope

Front

defined outside of a function

Back

Undefined

Front

No set value, result of inaction, var x

Back

Var variable scope and reassignment

Front

Its current execution context, global if declared outside of a function, local if declared within a function, can be reassigned let x = 1; let x = 2

Back

Unary operator

Front

only applies to 1 operand, num1++ , num1--

Back

Anonymous functions Traditional Syntax?

Front

unnamed functions, don't have purpose outside of a specific scope function() { //statements }

Back

Closure

Front

a function defined within another function

Back

What is true in JavaScript? What is false?

Front

True: everything that is not false False: 0, empty strings, NaN, null, undefined

Back

All JavaScript types

Front

numbers, strings, booleans, objects, functions, special values: undefined, null

Back

Const variable scope

Front

Constant with local block scope, can't be reassigned, const x = 1; const x = 2 → error

Back

Variable not declared with with var, let or const scope Ex: myVar = 1;

Front

No declared scope, creates myVariable property on a global object

Back

JavaScript Functions

Front

- don't check parameter types - don't check # of arguments passed - are objects

Back

Null

Front

non value, used to represent the consequence of an action that has no result, var x = null

Back

Let variable scope

Front

local block scope, can't be used before declaration, can't be reassigned let x = 1; let x = 2 → error

Back

Which data types in JavaScript are passed by value? Which are passed by reference?

Front

By value: simple (numbers, strings, booleans) By reference: complex (objects, arrays)

Back