Javascript Essentials Flashcards

memorize terms

1
Q

Function Overloading

A

the ability to create multiple functions of the same name with different implementations

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

whitespace

A

invisible characters that create literal ‘space’ in your written code

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

Immediately Invoked Function Expressions

A

a JS expression that runs as soon as it’s defined

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

Array

A

a variable that holds many values insdie of it []

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

arguments

A

the parameters that you pass to a function

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

mutate

A

to change a value

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

immutable

A

cannot be changed

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

JSON

A

Javascript Object Notation

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

First Class Functions

A

everything you can do with other types you can do with functions, assign them to variables, pass them around, create them on the fly. function names can be anonymous. Functions are an object whose code happens to be the properties on that object.

First Class Functions = Functional Programming

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

Function expression

A

a unit of code that results in a value. It doesn’t have to save a variable. Usually created on the fly.

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

function statement

A

a function that just ‘does work’

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

Namespace

A

a container for variables and functions, typically to keep variables and functions with the same name seperate.

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

Primitive Property

A

number, boolean, string

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

Object Property

A

Object within Object

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

Function Method

A

a function that is connected to an object

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

Operator

A

a special function that is syntactically (written) differently.

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

Precedence

A

which operator gets called first (PEMDAS)

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

Associativity

A

what direction operator functions get called in L->R R->L

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

coercion

A

converting a value from one type to another

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

array.filter()

A

creates a new array with all elements that pass the test implemented by the provided function.

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

array.map()

A

creates a new array with the results of calling a provided function on every element in the calling array

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

array.reduce()

A

method executes a reducer function (that you provide) on each element of the array, resulting in a single output value. The reducer function takes four arguments:

Accumulator (acc)
Current Value (cur)
Current Index (idx)
Source Array (src)

Your reducer function’s returned value is assigned to the accumulator, whose value is remembered across each iteration throughout the array and ultimately becomes the final, single resulting value.

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

trim

A

method removes whitespace (spaces, newlines, tabs, and similar) from the start and end of a string

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

padstart()

A

The padStart() method pads the current string with another string (multiple times, if needed) until the resulting string reaches the given length. The padding is applied from the start (left) of the current string.

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

string.length()

A

accessing individual characters in a string looks like accessing array elements. It returns count of total number of characters. The length of java string is same as the unicode code units of the string.

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

rest parameters (…Args)

A

it can useful for a function to accept any number of arguments. The rest parameter syntax allows us to represent an indefinite number of arguments as an array.

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

array.indexOf()

A

method searches through the array from the start to the end and returns the index at which the value was found, or -1 if not found.

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

array.slice()

A

takes the start and ending indexes and returns an array that has only the elements between them. The slice() method returns a shallow copy of a portion of an array into a new array object selected from begin to end (end not included). The original array will not be modified.

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

array.concat()

A

The concat() method is used to merge two or more arrays. This method does not change the existing arrays, but instead returns a new array.

30
Q

array.splice()

A

The splice() method changes the contents of an array by removing or replacing existing elements and/or adding new elements

31
Q

indexOf()

A

The indexOf() method returns the first index at which a given element can be found in the array, or -1 if it is not present.

32
Q

lastIndexOf()

A

The lastIndexOf() method returns the index within the calling String object of the last occurrence of the specified value, searching backwards from fromIndex. Returns -1 if the value is not found.

searchValue: A string representing the value to search for. If searchValue is an empty string, then fromIndex is returned.

Takes an optional second argument that indicates where to start searching.

33
Q

array.push() & array.pop()

A

add and remove elements at the end of an array.

34
Q

array.shift() & array.unshift()

A

add and remove elements at the start of an array.

35
Q

array.includes()

A

The includes() method determines whether an array includes a certain value among its entries, returning true or false as appropriate.

36
Q

==

A

compares by identity, it will produce true only if both objects are precisely the same value.

37
Q

stack

A

a data structure that allows you to push values to it, and remove them as well.

38
Q

properties

A

all .js values have properties, exception is null and undefined

39
Q

delete

A

operator unary, when applied to an object property, will remove the named property from the object

40
Q

object

A

arbitrary collections of properties

41
Q

pure function

A

a specific kind of value producing function that not only has no side effects but doesn’t rely on side effects from other code. -> doesn’t read global bindings whose value might change.

42
Q

recursion

A

a function that calls itself until a base case is reached and some value is returned.

43
Q

closure

A

being able to reference a specific instance of a global binding in an enclosing space, a function that references bindings from local scopes around it.

44
Q

function definition

A

a regular binding where the value of the binding is a function.

45
Q

local binding

A

created for function parameters or declared inside a function, can be referenced only by that function.

46
Q

enumerable

A

any property you add to an object (not those that are inherited) can be iterated over.

47
Q

pseudoclassical instantiation

A

prototype in JS is just a property on a function that points to an object, or a property that every js function has that points to an object

48
Q

object.create

A

allows you to create an object that will delegate to another object on failed lookups. consults another object to see if that object has the property.

49
Q

prototype

A

every function in Javascript has a prototype property that references an object, allows us to share methods across all instances of a function.

50
Q

functional instantiation

A

encapsulate logic inside a function that can be invoked when creating new instances of an object. Called a constructor function, since it is possible for constructing an object.

51
Q

dynamic typing

A

you don’t tell the engine what type of data a variable holds, it figures it out while your code is running.

52
Q

Syntax Parser

A

a program that reads your code and determines what it does and if its grammer is valid.

53
Q

Class

A

Classes are in fact “special functions”, and just as you can define function expressions and function declarations, the class syntax has two components: class expressions and class declarations.

54
Q

constructor method

A

A JavaScript class is a type of function. Classes are declared with the class keyword. The constructor method is a special method for creating and initializing an object created with a class. There can only be one special method with the name “constructor” in a class. A SyntaxError will be thrown if the class contains more than one occurrence of a constructor method.

55
Q

null

A

intentionally having no value

56
Q

undefined

A

a declared variable that hasn’t been assigned a value yet

57
Q

boolean

A

true or false

58
Q

Symbol

A

a unique value that’s not equal to any other value. Note, this is an ES6 feature that never really took off, so don’t worry about it for now.

59
Q

string

A

a series of characters (letters, numbers, spaces, symbols, etc.) wrapped in quotes

60
Q

Object

A

Objects in JavaScript, just as in many other programming languages, can be compared to objects in real life. Objects are standalone entities, with properties stored in key/value pairs. Compare it with a person, for example. A person is an object, with properties. A person has a race, a date of birth, a weight, a height, an eye color, etc. The same way, JavaScript objects can have properties, which define their characteristics.

61
Q

array

A

Used to store multiple values in a single variable. Similar to a list. Technically, arrays are objects in JavaScript, but we’ll dive into that more in second half of the pre-course.

62
Q

escape sequences

A

ways of formatting characters in strings.
Anytime JavaScript sees a () inside of a string, it knows that the following character has a special meaning. Here is a list of some of the most common escape sequences:

\' => single quote
\" => double quote
\\ => backslash
\n => newline
\r => carriage return
\t => tab
\b => backspace
\f => form feed
63
Q

template literals

A

Template literals are a special type of string that make creating complex strings so much easier. Template literals are created by surrounding text between opening and closing backticks (``). Inside a template literal, you’re able to refer to variables or execute code by using ${}

64
Q

The exponentiation operator (**)

A

The exponentiation operator (**) raises the first number to the power of the second number.

65
Q

== and !=

A

is loosely equal/not equal to

66
Q

=== and !==

A

is strictly equal/not equal to

67
Q

parseInt()

A

The parseInt() function parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems).

68
Q

hoisting

A

variable and function declarations are put into memory during the compile phase, but stay exactly where you typed them in your code.

69
Q

free variable

A

a variable that is outside a function but you have access to.

70
Q

string.substring()

A

The substring() method returns the part of the string between the start and to but not including the end indexes, or to the end of the string if only one index given.

71
Q

array.slice(i, i)

A

method returns a shallow portion of an array object into a new array object from beginning endex to ending index, or to end of array if index not provided.

72
Q

array.unshift(things to add)

A

The unshift() method adds one or more elements to the beginning of an array and returns the new length of the array.