null / string / array. None is an ArrayBuffer → all false.
Real buffer.new ArrayBuffer(16) → true.
Safe call. Passing null does not throw.
Rule. Only the ArrayBuffer constructor’s result passes.
Example 3 — Views vs Buffer
TypedArray and DataView sit on a buffer. Only the buffer itself passes.
Underscore
var buffer = new ArrayBuffer(8);
var bytes = new Uint8Array(buffer);
var view = new DataView(buffer);
console.log(_.isArrayBuffer(buffer)); // true
console.log(_.isArrayBuffer(bytes)); // false
console.log(_.isArrayBuffer(view)); // false
console.log(_.isArrayBuffer(bytes.buffer)); // true
Type check. Both values are ArrayBuffers → both true.
Size check. Read byteLength when you care about capacity.
Empty is valid. Zero bytes still counts as an ArrayBuffer.
Rule. Do not mix “is a buffer?” with “how big is it?”.
Compatibility
Browser & Runtime Support
_.isArrayBuffer ships with Underscore.js 1.11.0+. It runs anywhere Underscore runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install underscore. ArrayBuffer itself is a standard ES2015 feature.
✓ Stable · Underscore 1.11+
_.isArrayBuffer()
Available in [email protected]+ (UMD / ESM). Works in evergreen browsers and current Node LTS when Underscore is loaded and ArrayBuffer exists.
100%With Underscore 1.11+
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.isArrayBufferUnderscore 1.11+
Bottom line: Safe for production once Underscore 1.11+ is on the page or in your bundle. Not a native browser API — load Underscore first. Prefer a pinned CDN version (e.g. [email protected]).
Frequently Asked Questions
_.isArrayBuffer(object) returns true only when the value is an ArrayBuffer — for example new ArrayBuffer(8). Regular arrays, TypedArrays, DataView, strings, numbers, null, and plain objects return false.
_.isArrayBuffer(new ArrayBuffer(8)) returns true. The docs pick a real ArrayBuffer on purpose: that is the type the helper looks for.
No. [] is a JavaScript array of values. An ArrayBuffer is a raw block of binary bytes. Underscore treats an array as not an ArrayBuffer.
No. A Uint8Array or DataView is a view onto a buffer, not the buffer itself. Use view.buffer if you need the underlying ArrayBuffer, then _.isArrayBuffer will return true.
typeof new ArrayBuffer(8) is "object", so typeof is too broad. instanceof ArrayBuffer usually agrees in the same window. Underscore uses the [object ArrayBuffer] tag, which is more consistent across iframes than instanceof.
No. It is a stable Underscore helper added in version 1.11.0, along with _.isDataView and _.isTypedArray. Use it to decide whether a value is the raw buffer before you wrap it in a view.