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
// function for validating parameter | |
const validateParam = (param2validate) => { | |
if (!param2validate) return false; | |
if (param2validate.length === 0) return false; | |
if (typeof param2validate != 'string') return false; | |
}; | |
const searchPhrase = (phrase, data) => { | |
if (validateParam(phrase) === false){ |
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 countDownTimer = (totalTime) => { | |
let timeFunc = setInterval(() => { | |
console.log(totalTime); | |
totalTime--; | |
if (totalTime < 0) { | |
clearInterval(timeFunc); | |
console.log("Time's Up!"); | |
} | |
}, 1000) | |
} |
NewerOlder