Contact: aviboots(AT)netvision.net.il
41,636 questions
54,299 answers
573 users
// Allocates 1MB = 1,048,576 bytes const buffer: Uint8Array<ArrayBuffer> = new Uint8Array(1024 * 1024); console.log(buffer.length); /* run: 1048576 */
// Allocates 1MB = 1,048,576 bytes const array: number[] = new Array(1024 * 1024).fill(0); console.log(array.length); /* run: 1048576 */
// Allocates 1MB = 1,048,576 bytes const buffer: Buffer = Buffer.alloc(1024 * 1024); console.log(buffer.length); /* run: 1048576 */