Javascript topics Flashcards
what are callbacks?
callbacks is when we pass a function as an arguement in another function to be invoked within that function. often use like do this thing then ___. can be sync or async
what are promises?
promises are a way we can handle async functions within javascript. they return an object which can be either Pending, Fulfilled, Rejected. The Promise object supports two properties: state and result.
While a Promise object is “pending” (working), the result is undefined.
When a Promise object is “fulfilled”, the result is a value.
When a Promise object is “rejected”, the result is an error object.
describe a closure
a func defined in a func that relies on data which lives in the outer func but when the inner func is returned it remembers the outer scope data. boss
what is the difference between var, const, and let
const is block scoped and cant be redefined, let is block scoped, var is function scoped
What are the different data types present in javascript?
idk know them all off the top of my head. or Number.
String.
Boolean.
Null.
Undefined.
BigInt.
Symbol.
Object.
what is this keyword in javascript.
just a reference to the execution context