for loops will yield better performance and the result you want to get. If you&#x27;re trying to log 5 times you shouldn&#x27;t be wasting memory with allocating an array or needlessly calling the forEach function or needlessly creating a callback. You&#x27;re just wasting garbage collection and cpu time with this