JS Flashcards

1
Q

Explain event delegation

A

a

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

Explain how this works in JavaScript

A

a

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

Explain how prototypal inheritance works

A

a

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

What do you think of AMD vs CommonJS?

A

a

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

Explain why the following doesn’t work as an IIFE: function foo(){ }();.
What needs to be changed to properly make it an IIFE?

A

a

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

What’s the difference between a variable that is: null, undefined or undeclared?
How would you go about checking for any of these states?

A

a

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

What is a closure, and how/why would you use one?

A

a

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

What’s a typical use case for anonymous functions?

A

a

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

How do you organize your code? (module pattern, classical inheritance?)

A

a

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

What’s the difference between host objects and native objects?

A

a

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

Difference between: function Person(){}, var person = Person(), and var person = new Person()?

A

a

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

What’s the difference between .call and .apply?

A

a

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

What’s the difference between .call and .apply?

A

a

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

When would you use document.write()?

A

a

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

What’s the difference between feature detection, feature inference, and using the UA string?

A

a

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

Explain Ajax in as much detail as possible.

A

a

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

What are the advantages and disadvantages of using Ajax?

A

a

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

Explain how JSONP works (and how it’s not really Ajax).

A

a

19
Q

Have you ever used JavaScript templating?

A

a

20
Q

Explain “hoisting”.

A

a

21
Q

Describe event bubbling.

A

a

22
Q

What’s the difference between an “attribute” and a “property”?

A

a

23
Q

Why is extending built-in JavaScript objects not a good idea?

A

a

24
Q

Difference between document load event and document DOMContentLoaded event?

A

a

25
Q

What is the difference between == and ===?

A

a

26
Q

Explain the same-origin policy with regards to JavaScript.

A

a

27
Q

Why is it called a Ternary expression, what does the word “Ternary” indicate?

A

a

28
Q

What is “use strict”;? what are the advantages and disadvantages to using it?

A

a

29
Q

Why is it, in general, a good idea to leave the global scope of a website as-is and never touch it?

A

a

30
Q

Why would you use something like the load event? Does this event have disadvantages? Do you know any alternatives, and why would you use those?

A

a

31
Q

Explain what a single page app is and how to make one SEO-friendly.

A

a

32
Q

What is the extent of your experience with Promises and/or their polyfills?

A

a

33
Q

What are the pros and cons of using Promises instead of callbacks?

A

a

34
Q

What are some of the advantages/disadvantages of writing JavaScript code in a language that compiles to JavaScript?

A

a

35
Q

What tools and techniques do you use debugging JavaScript code?

A

a

36
Q

What language constructions do you use for iterating over object properties and array items?

A

a

37
Q

Explain the difference between mutable and immutable objects.

A

a

38
Q

What is an example of an immutable object in JavaScript?

A

a

39
Q

What are the pros and cons of immutability?

A

a

40
Q

How can you achieve immutability in your own code?

A

a

41
Q

Explain the difference between synchronous and asynchronous functions.

A

a

42
Q

What is event loop?

A

a

43
Q

What is the difference between call stack and task queue?

A

a

44
Q

Explain the differences on the usage of foo between function foo() {} and var foo = function() {}

A

a