const arr= new Array(50)
for(let i = 0, len = arr.length; i < len; i++) {
const randomKey = Math.random().toString(36).slice(2)
arr[i] = randomKey
}
const cache = new Map();
let x
for(let i = 0, len = arr.length; i < len; i++) {
const item = arr[i];
const cacheEntry = cache.get(item);
if(cacheEntry !== undefined) {
x = cacheEntry
} else {
x = Math.pow(item, 5) * 321312;
cache.set(item, x);
}
}
const cache = new Map();
let x
for(let i = 0, len = arr.length; i < len; i++) {
const item = arr[i];
if(cache.has(item)) {
x = cache.get(item);
} else {
x = Math.pow(item, 5) * 321312;
cache.set(item, x);
}
}const cache = Object.create(null);
let x
for(let i = 0, len = arr.length; i < len; i++) {
const item = arr[i];
const cacheEntry = cache[item];
if(cacheEntry !== undefined) {
x = cacheEntry
} else {
x = Math.pow(item, 5) * 321312;
cache[item] = x;
}
}const cache = Object.create(null);
let x
for(let i = 0, len = arr.length; i < len; i++) {
const item = arr[i];
if(item in cache) {
x = cache[item]
} else {
x = Math.pow(item, 5) * 321312;
cache[item] = x;
}
}