Skip to content

Instantly share code, notes, and snippets.

@romaefGit
Created October 29, 2019 20:05
Show Gist options
  • Select an option

  • Save romaefGit/efc66567c9fa7d28cda32023c7ce441b to your computer and use it in GitHub Desktop.

Select an option

Save romaefGit/efc66567c9fa7d28cda32023c7ce441b to your computer and use it in GitHub Desktop.
JavaScript - Reviza si existe un valor en una variable de cualquier tipo
/**
* Autor - Romario Augusto Estrada Flórez -romarioestrada.ff@hotmail.com
* [existTheValue reviza que una variable no esté vacía.]
* @param {[Array, String, Integer, Float...]} value [El valor de la variable]
* @return {[Boolean]} [Returna true si existe, false si no]
*/
var existTheValue = function(value) {
if ((value == '') || (value == null) || (value == undefined) || (value == [])) {
return false;
} else {
return true;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment