Skip to content

Instantly share code, notes, and snippets.

@episage
episage / fastest_for.js
Last active August 26, 2024 15:36 — forked from DungGramer/fastest_for.js
Find fastest way to loop through an array in Javascript
const { performance } = require('perf_hooks');
const assert = require('assert');
const DURATION_COLUMN = 'time[ns]';
// Create 1000 random numbers
const createTestArray = length => Array.from({ length }, () => 1 + Math.floor(Math.random() * 1000));
const createReferenceArray = testArray => testArray.map(v => Math.ceil((v + 2) / 10));
const sumUp = array => array.reduce((sum, value) => sum + value, 0);
const computeBenchmark = v => Math.ceil((v + 2) / 10);
@eyecatchup
eyecatchup / mr.robot_season-2_easter-egg-sites.md
Last active June 19, 2025 13:34
A collection of "Mr. Robot" Season 2 Easter Egg Sites. #mrrobot #hackingrobot #robotegg