// After (faster, using modern JS features) array.forEach(item => doSomething(item)); If you could provide more details about what you're trying to achieve or improve, I could offer more targeted advice or examples.