-
-
Save midokhorshed/ada5c733b6150a8f20504cb067777621 to your computer and use it in GitHub Desktop.
doJob
This file contains hidden or 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
| const searchParams = new URLSearchParams(window.location.search); | |
| const doJob = (job, urlParam) => { | |
| // if (urlParam === undefined || searchParams.has(urlParam)) { | |
| if (urlParam !== undefined && searchParams.has(urlParam)) { | |
| job(); | |
| } | |
| }; | |
| const fn = function(){ | |
| console.log('Выполнить только если в URL есть нужный параметр'); | |
| } | |
| doJob(fn, 'dev'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment