What is the proper term for "name" in the example below:
What is a parameter
What is the proper term for the values 5 and 3 in the example below?
What is an argument
______ produce new values while _______ produce behavior
Ex:
5 + 5 produces a new value 10
console.log('hi'); produces a behavior
Expressions produce new values while statements produce behavior
How would you call this function?
greet("ben");
What is the result of the following piece of code:
"Ben!!!" be printed to the console
What is the result of the following code
A reference error will be produced! a is not defined
Are the following values truthey or falsey?
0, "", null, undefined, NaN
Falsey
Is a Function an example of a First Class Object?
Yes
_____ are finite in size and are copy-by-value
_____ are infinite in size and are copy-by-reference
simple data types, complex data types
This is how you can determine whether or not a piece of data is an array
Array.isArray()
What is the name of the following operators?
&&, ||, !
Logical Operators
What is a Higher Order Function
It is a function that accepts a function as input or returns a function
The three parameters for the function passed to each
The element/value, the index/key, the array/object
What is the scope of var, let, and const?
var is scoped to functions while let and const are scoped to code blocks
What is the role that logging values to the console plays in programming?
Logging is mainly used for debugging purposes. A programmer can peer into the program as it runs and, by logging a value at a certain point, can determine whether or not the program is behaving as expected.
What does the filter function do? What are its inputs and what does it return?
Filter returns an array of values from a collection that pass a test function. It accepts a collection and a test function as input. It returns an array.
What is the difference between copy-by-value and copy-by-reference?
Simple data types are copy-by-value which means that when a variable A is assigned to variable B, variable A copies the value held by B. If variable B changes, variable A is unchanged.
Complex data types are copy-by-reference which means if variable A is assigned to variable B, variable A copies the memory reference to the value held by B. If variable B changes, the reference changes and therefor A also changes.
Create a loop that iterates over an Object and prints out each key and each value in the object. Use the object below as an example:
What makes a Function a First-Class Object?
Functions can:
1) be stored in a variable
2) be accepted as an argument to a function
3) be returned by a function