JavaScript Flashcards
Is there a correlation between “JavaScript” and “Java”?
No. The name “JavaScript” is not in any way related or have anything to do with “Java”. The language was named “JavaScript” around the time when Java was gaining popularity and being heavily marketed.
What is another interchangeable name for JavaScript?
ECMAScript
As of 2009, we’re now at the point where all major browsers support what version of ECMAScript?
5
The word “while” in a for loop is a _____ structure.
control
What is the most common font face / type family used to denote <code></code> syntax in print and web?
Monospace, courier
CRUD
Create, Read, Update, and Delete.
In JavaScript, what is a decimal / whole number also and more commonly referred to as?
Integer
A ___ ________ is represented by zeros and ones.
bit sequence
What is the binary equivalent number of 13?
00001101
What are the 6 basic value types in JavaScript?
Numbers, strings, booleans, objects, functions, and undefined values.
JavaScript uses a fixed number of how many bits to store a single number value?
64
64 bits is the equivalent of roughly how many different numbers?
18 quintillion
What does the letter “e” represent in the number 2.998e8?
Exponent
6.78 is a __________ number.
fractional, floating point.
__________ digit numbers are approximations and not precise values.
Fractional
The main thing to do with numbers in JavaScript and other programming languages is this.
Arithmetic
What is the singular term used to represent The + and * in JavaScript?
Operator
The __________ of each operator determines the order in which calculations are made.
precedence
The “modulo” otherwise known as the _________ operator.
remainder
You are ________ a character by preceding it with a backslash.
escaping
When the “n” character occurs after a backslash, it is interpreted as what?
A new line
How is the tab character in a string represented?
\t
Strings are not added but ____________ together.
concatenated
“mic” + “hel” + “ “ + “joan” + “isse”
A string concatenation
typeof is a _____ operator.
unary
This operator produces a string value naming the type of value you give it.
typeof
Operators that use two values are called ______ operators, while those that only take one are called _____ operators.
binary, unary
Which of the two (uppercase or lowercase) letters has higher precedence in a string value?
lowercase
The actual and precise string character ordering is based on the _______ standard.
unicode
What is the only number in JavaScript not equal to itself?
NaN
A fragment of code that produces a value is called an __________.
expression
A program is simply a list of __________.
statements
A variable name cannot include punctuation, except for these 2 characters.
$ _
If you ask for the value of an empty variable, you’ll get what value?
Undefined
var, break, for, else, switch, true, typeof, continue, null, this […]
Special meaning words are referred to as “keywords”.
Executing a function is called ________, _______, or ________ it.
invoking, calling, applying
This function takes any number of number values and gives back the greatest.
Math.max
When a function produces a value, it is said to ______ that value.
return
This function converts a value to a number.
Number
A for loop is this control flow type.
Conditional Execution
Curly braces do for statements what parentheses do for expressions: they _____ them together, making them count as a ______ _________.
group, single statement
A sequence of statements wrapped in braces is called a _____.
block
The “do” loop differs from the “while” loop only on one point, what is that point?
A “do” loop always executes its body at least once and it starts testing whether it should stop only after the first execution.
Values passed to functions are called _________.
arguments
When this keyword is encountered in a loop body, control jumps out of the body and continues with the loop’s next iteration.
continue
Why does the number function begin with a capitalized letter?
To convey / mark the function as a constructor.
There are two kinds of flow control disturbances, what are they?
Conditional and looping statements.
What does JSON stand for?
JavaScript Object Notation
The environment encapsulates what in common JavaScript terminology?
The set of defined variables.
A statement ends with this character.
;
Part of the browser that reads, understands, and runs the instructions in a JavaScript program.
JavaScript Interpreter
When a browser follows the instructions in a program, it ____ or ________ that program.
runs, executes
3.8712 and .00009 are this kind of number.
Floating Point
What are the 3 types of numbers in JavaScript?
Integers (whole), Fractional (floating point), Scientific Notation.
The “plus” symbol is more technically referred to as this.
Addition Operator
What does Math.random() produce?
A random number from 0 up to but not including 1 (e.g. 0.9127127448).
===
Strict equality operator; compares the type, as well as the value.
A condition always ________ to true or false.
evaluates
True or false: Just 1 of multiple “or” conditions (expressions) needs to evaluate as true in order for the entire larger conditional to return true.
true
// \_\_\_\_\_\_\_\_\_\_\_\_ functions and variables. // self \_\_\_\_\_\_\_\_\_\_ at script run time. (Function() { })();
Encapsulates, invocation
var myStore = {};
Object literal notation
What will the following function return?
myFunc() {
Math.floor(Math.random() * 6) + 1;
}
A randomly generated whole number between 1 and 6.
A function expression let’s you assign a function to a ________.
variable
A function “expression” let’s you assign a function to a ________.
variable
A function “expression” let’s you assign a function to a ________.
variable
// true or false? var alertMe = function() { alert("This function is anonymous, it has no name."); }
True
// true or false? var alertMe = function() { alert("This function is anonymous, it has no name."); };
True
This character is required after the final brace when declaring an anonymous function.
;
“return” exits a function and send a value back to the spot in the program where the function was called.
True
Variables, arrays, objects, are ____ _________.
data structures
The following statement is what type of array? var myShopping = [ ];
Array Literal
// Each singular value in this array is an "array \_\_\_\_\_\_". var players = ['Jim', 'Shawna', 'Andrew', 'Lora', 'Aimee', 'Nick'];
indice
Can you use the push( ) method to add more than one item to an array at a time? For example, is this valid:
scores.push( 77, 76, 89 );
True
An ______ is a container for values in the form of __________ and functionality in the form of _______.
object, properties, methods
Objects: The name of the property is a ___.
key
The condition of all values at a particular point in time is referring to the object’s _____.
state
What are the three kinds of objects?
native, host, custom
Values stored in objects are called
properties
Functionality encapsulated by an object is called a
method
The technique used in JavaScript to share functionality between similar types of objects is known as what?
Prototypal Inheritance
You _______ a variable name.
declare
Name the 5 primitive data types in JavaScript.
Number, String, Boolean, Undefined, Null
Simply put, in the context of data types, primitive means what?
They are not objects; they are primitives -
“simple data types”.
Describe the difference between Undefined and Null.
“Undefined” means there’s a variable but it has no value; on the contrary, “Null” means no variable by that name / reference exists.
JavaScript has something called “Dynamic Typing”, what does that mean?
It means you don’t have to manually define the data type of a variable, JavaScript does it on it’s own, and on the fly.
What is type coercion?
It means JavaScript converts data types on the fly as needed, this happens when when data types are mixed.
What is variable mutation?
“Variable Mutation” is the technically correct and fancy way of saying “changing the value of a variable”.
Why are functions sometimes referred to as “first-class citizens” in JavaScript?
Because they can be store in variables or passed to functions like any other data types.
True or False: A parent experiences the same event a child (element) does because of “event bubbling”.
True
What is the callback function that is passed to addEventListener often referred to as?
An event handler
Why is a web proxy useful for AJAX requests?
It allows you to bypass a web browser’s same-origin policy by retrieving data from another server, while keeping AJAX requests within the same domain.
What do we call the style of programming where we describe the final result, and not the steps?
Declarative
What is React?
A library for creating user interfaces.
What do we call the style of programming where we write out step by step what to do?
Imperative
What tool do we use to translate JSX files into standard JavaScript?
Babel
True or False: A React component must return only a single virtual DOM element.
True
True or False: You can use if / else statements inside JSX expressions.
False
In React, breaking up a larger component in to smaller components that can be composed together is referred to as what?
Decompose / Decomposition
In React, a method of combining many smaller or simpler pieces to create a larger piece is known as what?
Composition
In React, which function allows you to create a list of JSX elements from an array of JavaScript values?
array.map
In React, which property is required on components generated in a loop?
Key
True or False: The React community has several state management libraries for use with React.
True
When using React.class
, you do not need to call .bind()
on methods in order to keep the reference to “this” intact.
True
In React, it’s good practice to concentrate our application state high in our virtual DOM tree.
True