Last active
February 7, 2020 00:13
-
-
Save fransafu/5c02e80f8e9e91b3c5cb2cd727f851d6 to your computer and use it in GitHub Desktop.
Ejemplo de uso de modulo propio en Node.js
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
// checkIfString verifica si el parametro corresponde a un String | |
const checkIfString = (str) => { | |
if (typeof str === 'string' || str instanceof String) { | |
return true; | |
} | |
return false; | |
} | |
// checkIfNumber verifica si el parametro ingresado corresponde a un Numero | |
const checkIfNumber = (num) => parseInt(num) === num; | |
module.exports = { | |
checkIfString, | |
checkIfNumber, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment