Skip to content

Instantly share code, notes, and snippets.

@seemcat
Created January 8, 2019 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seemcat/30eef1e44ecf861b04bc041c5faf997d to your computer and use it in GitHub Desktop.
Save seemcat/30eef1e44ecf861b04bc041c5faf997d to your computer and use it in GitHub Desktop.
c0d3 solved in JS
const solution = (num1, num2, func) => {
setTimeout(() => {
func();
setTimeout(() => func(), num2);
}, num1);
};
// Test by checking to see if console.log's
// are being printed out accordingly.
const testFunc = () => console.log("hello");
console.log('test: ', solution(200, 1000, testFunc));
module.exports = {
solution,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment