Javascript | Tips
Como saber el tipo de nuestras variables u objetos /* Crearemos una funcion en el cual le pasamos un valor y nos devuelve el tipo de dato ---------------------------------------------------------------------*/ function GetType () { return Object . prototype . toString . call ( arguments [ 0 ]); } console . log ( '→ ' , GetType ( 123 )); // → [object Number] console . log ( '→ ' , GetType ( false )); // → [object Boolean] console . log ( '→ ' , GetType ({})); // → [object Object] console . log ( '→ ' , GetType ([ 'ss' , 22 ])); // →...