async/await allows write asynchronous programs without understanding how asynchronicity works, that if you put those “decorations” in your code, then you can stay sequencial and don’t understand what the code does. What we need to do is embrace asynchronicity
#javascript#parseq
async/await works and produces cleaner code, but is the wrong paradigm, is trying to keep you in this sequential mindset and you’ll never use the network correctly.
#javascript#parseq
function matrix(m, n, initial) {
let a, i, j, mat = [];
for (i = 0; i < m; i += 1) {
a = [];
for (j = 0; j < n; j += 1) {
a[j] = initial;
}
mat[i] = a;
}
return mat;
};
#javascript#matrix is my nigga
a loop where the indexes are moving through the list can be modeled recursively as the list getting shorter cause if you move index from 0 to 1 is the same as taking the item off the list, do something and then you’ve a shorter list like if index has moved
#javascript#recursion