This file contains 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
// YYYY-MM-dd | |
// using separator - | |
// https://www.regexpal.com/?fam=104039 | |
function isDate(value) { | |
return /([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))/.test(value) | |
} | |
// dd-MM-YYYY | |
// using separators - or . or / | |
// https://regexr.com/?346hf |
This file contains 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
/** | |
* @param {Array} array | |
* @returns {Array} | |
*/ | |
function shuffleArray(array) { | |
let currentIndex: number = array.length; | |
let randomIndex: number; | |
while (currentIndex !== 0) { | |
randomIndex = Math.floor(Math.random() * currentIndex); |
This file contains 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
<button type="button" id="topButton" onclick="topFunction()">Top</button> | |
<style> | |
#topButton { | |
display: none; | |
position: fixed; | |
bottom: 25px; | |
right: 30px; | |
z-index: 99; | |
} | |
</style> |