forEach does not wait for the promises its callback returns, so the code after it runs before the work finishes. Use for...of or Promise.all(items.map(...)).Object.hasOwn(obj, key) to test for the object's own keys, or the in operator if inherited keys should count too.value === undefined; for a variable that might not exist at all use typeof value === "undefined".var is scoped to the whole function and is hoisted as undefined; let is scoped to the nearest block and throws if you touch it before its declaration.Intl.DateTimeFormat (or toLocaleDateString) with options for a localized format, or toISOString() for a machine-readable one.Set and spread it back into an array: [...new Set(items)].str.replaceAll(search, replacement). On older runtimes use str.replace(/search/g, replacement).Try Bugsee for free — no commitments, no hidden fees.