Skip to content

Instantly share code, notes, and snippets.

View pde-rent's full-sized avatar
🏠
Working from home

Paul pde-rent

🏠
Working from home
  • Paris
View GitHub Profile
@pde-rent
pde-rent / bonus.js
Last active March 7, 2021 14:08
Bonus questions: hasAllNumeric + missingCharacter
const NUMERIC_REGEX = /^[-+]?[\d.]+(?:e-?\d+)?$/;
/**
* Checks if a string only contains digits, and complies as number
* @param {String} str - The string
* @returns {boolean}
*/
function isNumeric(str) {
return NUMERIC_REGEX.test(str);
}