Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/esm/bytes.js>copy

A JavaScript extension package for building strong and modern applications.
Latest
function copy
import { copy } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/bytes.js";

Copies bytes from src array to dest and returns the number of bytes copied.

Examples

Example 1

import { copy } from "@ayonli/jsext/bytes";

const src = new Uint8Array([1, 2, 3, 4, 5]);
const dest = new Uint8Array(3);

const n = copy(src, dest);

console.log(n); // 3
console.log(dest); // Uint8Array(3) [ 1, 2, 3 ]

Parameters

src
dest