wrong answers Flashcards

1
Q

parse() static method for Date

A

takes a date string entered in the ISO 8601 extended format and converts the date to number of milliseconds

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

now() static method for date

A

returns number of milliseconds since jan 1 1970

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

event bubbling is the default type of event propagation that occurs when an event occurs

A

true (to stop, set to true)

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

mock

A

in unit testing, a mock is needed to test code that is impractical to test under normal circumstances. a mock is usually an object that has the same data and behaviors of a real object that is returned from an actual server

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

elements panel of the browser dev tools

A

you can use to inspect elements and modify their attributes

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

strict mode

A

variables are required to be declared first before they can be used or assigned to a value. otherwise, an error will be thrown.

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

scope vs. watch

A

scope: shows local and global vars and their values, including closure variables; here you can also edit the values directly by double-clicking on them
watch: checking variable values as well but does not give info about variable scope

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

in newest version of node, how do you debug

A

node inspect index.js

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

in order to define a privileged function…

A

a developer can make use of a closure

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

onevent handlers

A

can be used to assign a single event to an HTML element; the onevent handler is assigned to the HTML element using dot syntax. the assignment operator is used to designate teh function that will be invoked when the next event occurs. the onevent handlers are all lowercase such as onclick

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

the filter method

A

create a new array that passes the given condition

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

the filter method

A

create a new array that passes the given condition

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

when using a default export…

A

the function or variable can be assigned any name on import

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

monitorEvents

A

can be used to display the event object for a particular event or category of events. the first parameter is the object for which events are monitored. the second parameter can be a category of events (like mouse or key), a specific event like click, or an array that contains specific events

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

call, apply, bind

A

call and apply: indirectly invoke a function; these methods can be used to establish that they keyword ‘this’ references by passing an object as the first parameter
apply - receives arguments in an array
bind: returns a new function; the returned function has a value bound to the this keyword

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

this property

A

cannot be accessed from within a nested function in a class method

17
Q

truths about the DOM

A

the document represents the whole web page
every object located in the DOM is called a Node

<h1> and <img></img> are examples of the element data type</h1>

18
Q

valid ways to retrieve the directory of a given file

A

path. parse(file).dir

path. dirname(file)

19
Q

decorators

A

multiple decorators are allowed to be used in classes and class properties. the decorators are evaluated top to bottom. then the results are called as a function from bottom to top.

20
Q

then statements

A

should return a value in order to implement promise chaining

21
Q

to prevent console from clearing when a page reloads

A

enable “Preserver Log” in the browser

22
Q

throw statement

A

allows a developer to create an exception and to define the exception message
the throw statement will stop the execution of the current function and then pass control to the catch block

23
Q

import as a function

A

returns a promise (so you can use chaining) / any exported values can be used from the module passed in as an argument

24
Q

decorators of classes

A
the prototype should be accessed via the first argument of the decorator function
the decorator function receives only one argument as it is being used as a class decorator
25
Q

Promise.race()

A

returns a promise as soon as one of the promises passed to it is fulfilled or rejected