wrong answers Flashcards
parse() static method for Date
takes a date string entered in the ISO 8601 extended format and converts the date to number of milliseconds
now() static method for date
returns number of milliseconds since jan 1 1970
event bubbling is the default type of event propagation that occurs when an event occurs
true (to stop, set to true)
mock
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
elements panel of the browser dev tools
you can use to inspect elements and modify their attributes
strict mode
variables are required to be declared first before they can be used or assigned to a value. otherwise, an error will be thrown.
scope vs. watch
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
in newest version of node, how do you debug
node inspect index.js
in order to define a privileged function…
a developer can make use of a closure
onevent handlers
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
the filter method
create a new array that passes the given condition
the filter method
create a new array that passes the given condition
when using a default export…
the function or variable can be assigned any name on import
monitorEvents
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
call, apply, bind
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