- Explain event delegation
- Explain how
this
works in JavaScript - What is a closure, and how/why would you use one?
- Explain the difference between synchronous and asynchronous functions
- Explain
Function.prototype.bind
. - Explain
Ajax
in as much detail as possible. - Explain "hoisting".
- Describe event bubbling.
- Describe event capturing.
- What are the differences between variables created using
let
,var
orconst
?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImagePtr { | |
public: | |
ImagePtr(const char* imageFile); | |
virtual ~ImagePtr(); | |
virtual Image* operator->(); | |
virtual Image& operator*(); | |
private: | |
Image* Loadlmage(); | |
private: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Extent { | |
width: number; | |
height: number; | |
} | |
abstract class Graphic { | |
protected fileName: string; | |
abstract getExtent(): Extent; | |
abstract draw(): void; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Component { | |
operation(): void; | |
} | |
class ConcreteComponent implements Component { | |
public operation() { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Minion { | |
behit(damage: number): void; | |
getBlood(): number; | |
} | |
class SilverHandRecruit implements Minion { | |
private blood: number = 10; | |
behit(damage: number) { | |
this.blood -= damage; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Do this | |
Component c, c1; | |
c = new ConcreteComponent(); | |
c1 = new ConcreteDecorator(c); | |
// Do not | |
ConcreteComponent c; | |
c = new ConcreteComponent(); | |
ConcreteDecorator c1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Component { | |
operation(): void; | |
} | |
class ConcreteComponent implements Component { | |
public operation() { | |
console.log('origin opration'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function simulate(element, eventName) { | |
var event; // The custom event that will be created | |
if (document.createEvent) { | |
event = document.createEvent("HTMLEvents"); | |
event.initEvent(eventName, true, true); | |
} else { | |
event = document.createEventObject(); | |
event.eventType = eventName; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require("webpack"); | |
module.exports = { | |
entry: { | |
app: "./app.js", | |
vendor: ["jquery", "underscore", ...], | |
}, | |
output: { | |
filename: "bundle.js" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Promise = require('es6-promise').Promise; | |
var funcs = []; | |
funcs[0] = function (cb) { | |
setTimeout(function () { | |
console.log(1); | |
cb(); | |
}, 2000); | |
}; |