diff --git a/lib/buffer.js b/lib/buffer.js index 3668494334a666..59e8598a41891a 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -428,6 +428,14 @@ Buffer.prototype.indexOf = function indexOf(val, byteOffset) { throw new TypeError('val must be string, number or Buffer'); }; +Buffer.prototype.includes = function includes(val) { + if (this.indexOf(val) === -1) + return false; + else + return true; + + throw new TypeError('val must be number'); +}; Buffer.prototype.fill = function fill(val, start, end) { start = start >> 0;