Operators and Functions Flashcards

1
Q

Increment and decrement unary operators can be used [..] and [..]

A

Prefix and postfix

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Using [..] on an array replaces the value with ‘undefined’, leaving the index in place

A

Delete

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the most succinct way of finding the minimum number in an array?

A

Math.min.apply(null, arr)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Higher order functions allow us to abstract over [..], not just values

A

Actions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Second element in a regex/string match object

A

The first matched group

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The shorter way to create a function binding is a function [..]

A
Declaration
(
function square(x) {
return x*x;
}
)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

If an expression corresponds to a sentence fragment, then a [..] corresponds to a sentence.

A

Statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Postfix operators return the value [..] operating

A

Before

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Functions that automatically (when g or y modifiers are enabled) resets the lastIndex regex object property to 0 after a failure to match

A

test() and exec()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Bindings declared with ‘let’ and ‘const’ are local to the [..] that they are declared in.

A

Block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Array method that returns the index of the element matching the argument.

A

indexOf()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Syntax for rest parameters or spread operator

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Function [..]s can be declared anywhere

A

Declaration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Methods usually act on the [..] they are a property of

A

Value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Bitwise not, which inverts all the bits in the operand and returns a number…

A

~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A function [..] is a regular binding where the value of the binding is a function.

A

Declaration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

[..] are functions that live in properties

A

Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

An [..] is a symbol/sign that maps [..] to output values

A

Operator

Operandi

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

If you try to destructure [..] or [..] you will get an error

A

Null

Undefined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Date object convention - day numbers start at

A

1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Delete does not work on any [..]

A

Non-configurable properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Regex (or string) method that returns a match object

A

Exec

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

A fragment of code that produces a value is called an [..]

A

Expression

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the Regexp string replacement method in JS?

A

replace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Every value in JS has a [..] that determines its role
Type
26
Delete works on functions which are part of an [..] (apart from the global scope)
Object
27
Unary operators cannot be [..]
Overridden
28
Most values have properties, but not [..] and [..]
Null | Undefined
29
If you omit a [..], the next line will be treated as part of the current statement.
Semi-colon
30
This operator converts to Boolean and then negates it
!
31
Timestamps are stored as the [..] since the start of 1970, UTC
Number of milliseconds
32
Using delete on an object’s property will... | ... but it won’t delete it from the [..]
Remove it from the object (thence returning undefined when accessed) Prototype chain
33
Method that returns a Boolean for a match on a regex
test
34
Functions that operate on other functions, by taking them as arguments or returning them, are called [..] function
Higher-order
35
Old-style variables, created using ‘var’, are [..] throughout the whole function they appear in (or else in the global scope).
Visible
36
Return value of unary + and - on functions and objects
NaN
37
Unary operator that yields a numeric expression
+
38
Function [..]s start with the function keyword.
Declaration
39
Arrays use [..] as the names of their properties
Numbers
40
There are some named properties of arrays, e.g. [..]
Length
41
First element in a regex/string match object
The whole matched string
42
This operator tries to convert the operand into a number and then negates it
-
43
Using a function as the second argument in a replace() method call, it will return..
A string
44
When a function produces a value, it’s said to [..] that value
Return
45
[..] means that the operator comes after the operand
Postfix
46
[..] operators are more efficient than standard JS function calls
Unary
47
A [..] is a piece of code wrapped in a value
Function
48
What key function in JS is ‘select’ in Ruby?
filter
49
When a regex/string group matches several times, [..] is returned in the match object
Only the first match
50
Function that converts an expression to JSON string
JSON.stringify
51
Global variable to reference the full match after a ‘replace’ call
$&
52
This method returns the index of the first regex match, or -1 if there wasn’t one
search
53
Function [..]s don’t require a semi-colon afterwards
Declarations
54
Regex object property that specifies the character position immediately following the last match
lastIndex
55
Using a function as the second argument in a replace() method call, [..] will be passed as arguments to that function
The matched groups (and the whole match)
56
JSON strings - [..] JavaScript, encoded so that it can be stored or sent
Serialized | Converted into a flat description
57
Date object convention - months start at
0
58
JSON stands for
JavaScript Object Notation
59
Unary operator that discards a return value of an expression
Void
60
Regex#test and Regex#exec will use this readable/writable property of the Regex object as a starting point for the match
lastIndex
61
Function that tests whether any element of an array matches a given predicate function
Some
62
Method on a date object that returns that number of milliseconds relative to 1970
getTime()
63
Function that finds the position (in an array) of the first element that matches a predicate
indexOf()
64
The collection of bindings and their values that exist at any given time is known as the [..]
Environment
65
A program is a list of
Statements
66
Function that parses a JSON string back into JS
JSON.parse
67
When a regex/string returns a match object, unmatched groups in the array will hold an [..] value
Undefined
68
In Regex, using this after a quantifier makes it lazy instead of greedy
?
69
Modifier for a regex to make it global
g
70
Prefix means that the operator comes [..] the operand
Before
71
All [..] in JSON strings have to be surrounded by double quotes.
Properties
72
A [..] operator is one that takes a single operand/argument and performs an operation.
Unary
73
[..] operators return the value after the operation
Prefix
74
A lazy quantifier consumes the [..] set of characters before returning a match
Smallest
75
Function that returns true when every element in an array returns true for a predicate function
Every