Javascript foreach() <p id=”demo”></p> <script> const numbers = [65, 44, 12, 4]; numbers.forEach(myFunction) document.getElementById(“demo”).innerHTML = numbers; function myFunction(item, index, arr) { arr[index] = item * 10; } </script> </body> Cook with me Share this content Opens in a new window X Opens in a new window Facebook Opens in a new window WhatsApp You Might Also Like ajax calling on scroll down October 30, 2023 Drag, copy and drop using javascript July 24, 2023 Calculator for invoice using javascript July 29, 2023 Leave a Reply Cancel replyCommentEnter your name or username to comment Enter your email address to comment Enter your website URL (optional) Save my name, email, and website in this browser for the next time I comment.