Skip to content

Instantly share code, notes, and snippets.

@elkhan
elkhan / ex1-prototype-style.js
Created August 8, 2022 18:04 — forked from getify/ex1-prototype-style.js
OLOO (objects linked to other objects) pattern explored (with comparison to the prototype style of the same code)
function Foo(who) {
this.me = who;
}
Foo.prototype.identify = function() {
return "I am " + this.me;
};
function Bar(who) {
Foo.call(this,"Bar:" + who);
@elkhan
elkhan / promise.ts
Created October 13, 2019 19:33 — forked from ORESoftware/promise.ts
Promise implementation in JS. IRL the Promise implementation is in C++ land, but most JS implementations than native for whatever reason.
'use strict';
// note! run this with Node.js version 11, as queueMicrotask is only supported
// in Node.js version 11.
declare var queueMicrotask: any;
const CancelSymbol = Symbol('cancel');
const RejectSymbol = Symbol('reject');
@elkhan
elkhan / README.md
Created November 15, 2017 15:16 — forked from hofmannsven/README.md
My simply Git Cheatsheet