xtodo JavaScript js

xtodo
xtodo
xtodo
xtodo
js iterator 2025-04-26 192d7
js iterator 2025-04-26 192d7
const xx = Array(4).fill(0).map((x, i) => x + i);
console.log(xx);
// [ 0, 1, 2, 3 ]

// yy = xx[Symbol.iterator];

// console.log( yy )

// console.log( yy() .next() )

console.log( xx[Symbol.iterator]().next(), );
// { value: 0, done: false }

console.log( xx[Symbol.iterator]().next(), );
// { value: 0, done: false }

/*
the complex javascript iterator generator interface fucks.

here, first is the complexity of no range function.
you got the fill method patch to deal with that.

then, am trying to deconstruct the iteratable interface, trying to get its next value.
but apparantly it resets.

very complex, because the iterable contains a property of type symbol, named Symbol.iterator.
it's value must be a function.
and it must return a object, this object must have a next property, and this property's value must be a function.
this is why u get this funky
xx[Symbol.iterator]().next()

its return value, is a object, that contains value and done keys.

yet, somehow it resets. am unable to get it to 0, 1, 2, 3, etc.
 */
xtodo
xtodo
xtodo
xtodo
xtodo
xtodo

JavaScript

Georrg, 11/03/2022 @XahLee standard library has walk and walkSync functions

import { walkSync } from "https://deno.land/std@0.162.0/fs/walk.ts";

for (const entry of walkSync(".")) {
console.log(entry.path);
}

a TypeScript and deno problem

const fCharStrToId = ((x) => x.codePointAt(0));
const fCharIdToStr = ((x) => (String.fromCodePoint(x)));
console.log(fCharStrToId("πŸ˜‚"));
js TypeScript george 2022-04-19
JavaScript TypeScript george 2022-04-19
js todo 2021-11-21 tmKkW
JavaScript todo 2021-11-21 tmKkW