Civet icon indicating copy to clipboard operation
Civet copied to clipboard

postfix loop implicitly assigns results = [] variable

Open yuzudev opened this issue 1 year ago • 0 comments

with no explicit declaration, eg: stuff := for x of loop the results variable is still assigned

((push shard for shard of bucket) for bucket of buckets)

// ↓↓↓ Civet 0.6.10

(() => {
  const results = [];
  for (const bucket of buckets) {
    results.push(
      (() => {
        const results1 = [];
        for (const shard of bucket) {
          results1.push(push(shard));
        }
        return results1;
      })()
    );
  }
  return results;
})();

yuzudev avatar Jul 06 '23 00:07 yuzudev