3 ms·
You can use generators to make cooperative multitasking inside one thread. I can'd do that with arrays. Generators aren't a data structure - or if they are, th
by ajuc 12y ago
You can use generators to make cooperative multitasking inside one thread. I can'd do that with arrays.
Generators aren't a data structure - or if they are, then functions are a data structure too. This isn't array, this is function:
function doStuff() {
return [
fs.readFile.bind(null, 'hello.txt'),
fs.readFile.bind(null, 'world.txt'),
fs.readFile.bind(null, 'and-such.txt')
];
}