// Creating some typedArray containing same values
const A = new Uint8Array([ 5, 10, 15, 20, 25 ]);
const B = new Uint8Array([ 5, 10, 15, 20, 25 ]);
const C = new Uint8Array([ 5, 10, 15, 20, 25 ]);
const D = new Uint8Array([ 5, 10, 15, 20, 25 ]);
const E = new Uint8Array([ 5, 10, 15, 20, 25 ]);
const F = new Uint8Array([ 5, 10, 15, 20, 25 ]);
// Calling slice function with starting and ending index
var a = A.slice(1, 2);
var b = B.slice(0, 3);
var c = C.slice(4);
var d = D.slice(0
// Here index is negative so it extract element
// from the end of the typedArray
var e = E.slice(-2);
var f = F.slice();
// Printing the extracted arrays
console.log(a);
console.log(b);
console.log(c);
console.log(d);
console.log(e);
console.log(f);