This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Тестовое задание: | |
Coding task: | |
Please write a function wrapper slow_guard(timeout, fn) that logs a warning if | |
the function takes too long to complete. Here is a typical example of how your wrapper can be used: | |
Array.prototype.sort = slow_guard(1000, Array.prototype.sort); | |
After this, if sorting an array ever takes longer than one second, a warning | |
should appear on the developer console. | |
We expect a short solution about 5-10 lines of code. | |
Ответ: Если опустить тот факт что так делать ни в коем случае не надо, |
OlderNewer