Title: Add test cases by XiaoWinter · Pull Request #1 · javascript-plunk/javascript-tutorial-en · GitHub
Open Graph Title: Add test cases by XiaoWinter · Pull Request #1 · javascript-plunk/javascript-tutorial-en
X Title: Add test cases by XiaoWinter · Pull Request #1 · javascript-plunk/javascript-tutorial-en
Description: I found a throttling method in the comments section that passed all the current tests but was wrong.So I added a test case to find this type of error.With this wrapping method, if the interval between two calls is greater than 1000ms, the wrapped method becomes invalid. function throttle(func, period) { let savedArgs let savedThis let start = true function runFunc() { if (savedArgs) { func.apply(savedThis, savedArgs) savedArgs = undefined setTimeout(runFunc, period) } } function wrapper(...rest) { savedThis = this savedArgs = rest if (start) { start = false runFunc() } } return wrapper }
Open Graph Description: I found a throttling method in the comments section that passed all the current tests but was wrong.So I added a test case to find this type of error.With this wrapping method, if the interval bet...
X Description: I found a throttling method in the comments section that passed all the current tests but was wrong.So I added a test case to find this type of error.With this wrapping method, if the interval bet...
Opengraph URL: https://github.com/javascript-plunk/javascript-tutorial-en/pull/1
X: @github
Domain: www.github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:37a733d7-1209-2d10-7cbd-a43e6280c065 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C4C2:D55D7:11C226:18307B:6A5A58F4 |
| html-safe-nonce | efd7c282c9527c501db736ac7e478430819155ea15da5f0a303895636544b0f5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNEMyOkQ1NUQ3OjExQzIyNjoxODMwN0I6NkE1QTU4RjQiLCJ2aXNpdG9yX2lkIjoiMjkyMDA0Mzk1NDQ2Mzk4Nzk1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3b46c617cfb8433f2bd4032a3eccced6a96ef8e7c9de0ff673158eab0aee2a13 |
| hovercard-subject-tag | pull_request:560475801 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/javascript-plunk/javascript-tutorial-en/pull/1/files |
| twitter:image | https://avatars.githubusercontent.com/u/41815901?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/41815901?s=400&v=4 |
| og:image:alt | I found a throttling method in the comments section that passed all the current tests but was wrong.So I added a test case to find this type of error.With this wrapping method, if the interval bet... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 05b9ddf6a47d2dbe13944873a99f5fb4b83ba4871f9cb8a8e256793a63ca9687 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/javascript-plunk/javascript-tutorial-en git https://github.com/javascript-plunk/javascript-tutorial-en.git |
| octolytics-dimension-user_id | 9218487 |
| octolytics-dimension-user_login | javascript-plunk |
| octolytics-dimension-repository_id | 104978456 |
| octolytics-dimension-repository_nwo | javascript-plunk/javascript-tutorial-en |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 93253246 |
| octolytics-dimension-repository_parent_nwo | javascript-tutorial/en.javascript.info |
| octolytics-dimension-repository_network_root_id | 93253246 |
| octolytics-dimension-repository_network_root_nwo | javascript-tutorial/en.javascript.info |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8d29d1bd03dda2dd14b3f80b8bc27e1111f43bd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width