Skip to content

Instantly share code, notes, and snippets.

@sylvainleris
sylvainleris / MiddlewareES6.js
Last active March 16, 2023 12:42 — forked from darrenscerri/Middleware.js
A very minimal Javascript (ES5 & ES6) Middleware Pattern Implementation
class Middleware {
constructor() {
// Array prototype last
if (!Array.prototype.last) {
Array.prototype.last = function() {
return this[this.length - 1];
}
}