Public
Edited
Apr 27, 2023
Insert cell
Insert cell
Insert cell
Insert cell
{
const b = new Int8Array([
97, 57, 100, 54, 49, 53, 100, 48, 45, 101, 51, 98, 99, 45, 52, 49, 101, 100,
45, 98, 51, 51, 49, 45, 50, 100, 98, 97, 57, 57, 48, 51, 56, 54, 49, 101
]);
b.reduce((a, i) => (a += String.fromCharCode(i))); // '979d615d0-e3bc-41ed-b331-2dba9903861e'
return {
b: b,
reduction: b.reduce((a, i) => (a += String.fromCharCode(i))), // '979d615d0-e3bc-41ed-b331-2dba9903861e'
"b[0]": String.fromCharCode(b[0]), // 'a'
"97": String.fromCharCode(97), // 'a'
"57": String.fromCharCode(57) // '9'
};
}
Insert cell
int8 =new Int8Array([97,57,100,54,49,53,100,48,45,101,51,98,99,45,52,49,101,100,45,98,51,51,49,45,50,100,98,97,57,57,48,51,56,54,49,101])
Insert cell
Insert cell
int8.reduce((a, i) => (a += String.fromCharCode(i)))
Insert cell
Insert cell
int8.reduce((a, i) => a + String.fromCharCode(i), "")
Insert cell
Insert cell
Insert cell
Array.from(int8)
.map((x) => String.fromCharCode(x))
.join("")
Insert cell
int8.reduce((a, i) => `${a}${String.fromCharCode(i)}`, "")
Insert cell
Insert cell
function primitiveReduce(array, fn) {
const [head, ...tail] = array;
let aggregator = head;
for (const [data, index] of tail.entries()) {
aggregator = fn(aggregator, data, index);
}
return aggregator;
}
Insert cell
Insert cell
import {toc} from "@mbostock/toc"

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more