Advanced
Refactor JavaScript Code
Improve the structure and performance of an existing function.
📝 Nội dung Prompt
Refactor the provided JavaScript function to use modern ES6+ syntax. Improve its readability by using meaningful variable names and reduce the time complexity of the algorithm.