13m Solution with closure: this line "let addedMessageTimeoutId" that is declared outside the loop doesn't achieve the expected result. But when I move inside the loop, it works fine. From what I asked chatGPT, even though this is a more advanced solution, the solution using objects is better in terms of scalability and maintainability. Can I get your opinion on this?
13m Solution with closure: this line "let addedMessageTimeoutId" that is declared outside the loop doesn't achieve the expected result. But when I move inside the loop, it works fine. From what I asked chatGPT, even though this is a more advanced solution, the solution using objects is better in terms of scalability and maintainability. Can I get your opinion on this?