
useEffect mistakesDiscover what’s new in The Replay, LogRocket’s newsletter for dev and engineering leaders, in the November 5th issue.

useEffect mistakes to avoid in your React appsShruti Kapoor breaks down the confusion around useEffect and goes over 15 common mistakes she’s seen in the React apps she’s reviewed.

MCP is the bridge between AI and the open web — giving intelligent agents the ability to act, not just talk. Here’s how this open protocol transforms development, business models, and the future of software itself.

AI agents can now log in, act, and access data, but have you truly authorized them? This guide walks through how to secure your autonomous agents using Auth0’s Auth for GenAI, covering token vaults, human-in-the-loop approvals, and fine-grained access control.
Would you be interested in joining LogRocket's developer community?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up now
3 Replies to "New ES2021 features you may have missed"
Hi, thanks for writing this good article, I love it.
However I want to propose a correction for Promise.all in Promise.any part, The Promise.all should be reject if any of the promise rejected and resolve if all promise resolved.
https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all
Keep writing good stuff.
That was a typo. Should have been promise.any not promise.all. It will be corrected.
“`
const promise1 = new Promise((resolve) => setTimeout((resolve) => resolve, 300, ‘faster’);
const promise2 = new Promise((reject) => setTimeout( (reject) =>reject, 100,”fastest”)
const promise3 = new Promise((resolve) => setTimeout( (resolve) => resolve,700,’fast’);
“`
This promise code is just completely wrong, even if you fix the missing closing brackets. Your `setTimeout` calls take a `resolve => resolve` callback, but this reject is not the one from the promise, it’s an internal parameter of the callback. You might as well have passed the callback `foo => foo` , and it will have the same result.
`promise2` even renames the “resolve” parameter as `reject`. Further adding to the wrongness.
I believe you meant:
“`
const promise2 = new Promise((_, reject) => setTimeout(reject, 100,”fastest”));
“`