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: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:16dcd9c7-0893-f8a5-d3cf-4e58a2c682cd |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B856:3499D7:129CCCB:191AD3A:6A56C2A6 |
| html-safe-nonce | b6ec0924215f8ff8798f509f43bcadc6fba078158ae3a8d03bd3861d3de24940 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODU2OjM0OTlENzoxMjlDQ0NCOjE5MUFEM0E6NkE1NkMyQTYiLCJ2aXNpdG9yX2lkIjoiMjIzOTc3OTM3NzcwNTYyMjE0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 629e3dd6da86a95c34901d612ccd54c6fe58b88ff4cecc401a67bbb81fe75313 |
| 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 | df99b7164e1d961b639cf5d3cbd6b5ba673edc67bd7e47cdc4746b96099e11ae |
| 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 | 829f7fb08f3c7a059361601ffe917f622508969c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width