mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
9 lines
230 B
JavaScript
9 lines
230 B
JavaScript
// ArrayBuffer inheritance
|
|
|
|
var a = new Int16Array(16);
|
|
ArrayBufferView.prototype.foo = function () { return 42; };
|
|
ArrayBufferView.prototype.bar = function () { return this[1]; };
|
|
a[1] = 43;
|
|
|
|
result = a.foo()==42 && a.bar()==43;
|