Karteikarten
Ohne Titel
Karten in diesem Stapel (9)
- 1What is a high order function ?A high order function is one which accepts another function as a arguments.
- 2What is a callback function ?A function passed as a parameter into another function is called callback function
- 3What is setTimeout ?An async fn that invokes a callback fn once after given time delay .
var id = setTimeout(callfn(){}, delay)
clearTimeout(id); - 4What is setInterval?An async fn that invokes a callback fn after every given time interval
var id = setInterval(callfn(){}, time)
clearInterval(id) - 5What is let and const ?1. Let and Const used to assign values to variables.
2. Let - similar to var and has block scope(loops, fncs etc)
3. const is constant values , cant be changed
4. cont obj & arr can be reassigned - 6What is an arrow function?1. shorter syntax
2. Don't have- this , arguments, super
3.Every new function has - this value
constructor - a new object ,
strict mode function calls -undefined
object method - base object
4. No prototype property - 7Why arrow function cannot be used as object methodsAs methods in objs, this points - window var obj = {i: 10,
b: () => console.log(this.i, this),
c: function() {
console.log(this.i, this); }}
obj.b(); // prints undefined, Window {...} (or the global object) - 8why arrow functions can't be used in constructors?Cannot be used with constructor , throw err with new
var Foo = () => {};
var foo = new Foo(); // TypeError: Foo is not a constructor - 9Import and Export
Informationen
- Beschreibung
- Karteikarten am Ohne Titel, erstellt von souravi sadashiv am 08/05/2018.
- Erstellt von
- souravi sadashiv
- Aufrufe
- 0
- Bewertung