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
Q

Every value in JS has a [..] that determines its role

A

Type

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

Delete works on functions which are part of an [..] (apart from the global scope)

A

Object

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

Unary operators cannot be [..]

A

Overridden

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

Most values have properties, but not [..] and [..]

A

Null

Undefined

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

If you omit a [..], the next line will be treated as part of the current statement.

A

Semi-colon

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

This operator converts to Boolean and then negates it

A

!

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

Timestamps are stored as the [..] since the start of 1970, UTC

A

Number of milliseconds

32
Q

Using delete on an object’s property will…

… but it won’t delete it from the [..]

A

Remove it from the object (thence returning undefined when accessed)

Prototype chain

33
Q

Method that returns a Boolean for a match on a regex

A

test

34
Q

Functions that operate on other functions, by taking them as arguments or returning them, are called [..] function

A

Higher-order

35
Q

Old-style variables, created using ‘var’, are [..] throughout the whole function they appear in (or else in the global scope).

A

Visible

36
Q

Return value of unary + and - on functions and objects

A

NaN

37
Q

Unary operator that yields a numeric expression

A

+

38
Q

Function [..]s start with the function keyword.

A

Declaration

39
Q

Arrays use [..] as the names of their properties

A

Numbers

40
Q

There are some named properties of arrays, e.g. [..]

A

Length

41
Q

First element in a regex/string match object

A

The whole matched string

42
Q

This operator tries to convert the operand into a number and then negates it

A

-

43
Q

Using a function as the second argument in a replace() method call, it will return..

A

A string

44
Q

When a function produces a value, it’s said to [..] that value

A

Return

45
Q

[..] means that the operator comes after the operand

A

Postfix

46
Q

[..] operators are more efficient than standard JS function calls

A

Unary

47
Q

A [..] is a piece of code wrapped in a value

A

Function

48
Q

What key function in JS is ‘select’ in Ruby?

A

filter

49
Q

When a regex/string group matches several times, [..] is returned in the match object

A

Only the first match

50
Q

Function that converts an expression to JSON string

A

JSON.stringify

51
Q

Global variable to reference the full match after a ‘replace’ call

A

$&

52
Q

This method returns the index of the first regex match, or -1 if there wasn’t one

A

search

53
Q

Function [..]s don’t require a semi-colon afterwards

A

Declarations

54
Q

Regex object property that specifies the character position immediately following the last match

A

lastIndex

55
Q

Using a function as the second argument in a replace() method call, [..] will be passed as arguments to that function

A

The matched groups (and the whole match)

56
Q

JSON strings - [..] JavaScript, encoded so that it can be stored or sent

A

Serialized

Converted into a flat description

57
Q

Date object convention - months start at

A

0

58
Q

JSON stands for

A

JavaScript Object Notation

59
Q

Unary operator that discards a return value of an expression

A

Void

60
Q

Regex#test and Regex#exec will use this readable/writable property of the Regex object as a starting point for the match

A

lastIndex

61
Q

Function that tests whether any element of an array matches a given predicate function

A

Some

62
Q

Method on a date object that returns that number of milliseconds relative to 1970

A

getTime()

63
Q

Function that finds the position (in an array) of the first element that matches a predicate

A

indexOf()

64
Q

The collection of bindings and their values that exist at any given time is known as the [..]

A

Environment

65
Q

A program is a list of

A

Statements

66
Q

Function that parses a JSON string back into JS

A

JSON.parse

67
Q

When a regex/string returns a match object, unmatched groups in the array will hold an [..] value

A

Undefined

68
Q

In Regex, using this after a quantifier makes it lazy instead of greedy

A

?

69
Q

Modifier for a regex to make it global

A

g

70
Q

Prefix means that the operator comes [..] the operand

A

Before

71
Q

All [..] in JSON strings have to be surrounded by double quotes.

A

Properties

72
Q

A [..] operator is one that takes a single operand/argument and performs an operation.

A

Unary

73
Q

[..] operators return the value after the operation

A

Prefix

74
Q

A lazy quantifier consumes the [..] set of characters before returning a match

A

Smallest

75
Q

Function that returns true when every element in an array returns true for a predicate function

A

Every