Advertisement
NubeColectiva

Cómo Saber Si Una Variable de Tipo Número Esta Vacía en TypeScript

Mar 18th, 2024
611
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let edad = 25;
  2.  
  3. if (typeof edad === 'number' && edad >= 0) {
  4.    
  5.     console.log("La variable No esta vacía");
  6.  
  7. } else {
  8.     console.log("La variable Si esta vacía");
  9. }
  10.  
  11. # Obtenemos
  12. La variable No esta vacía
  13.  
Tags: ts typescript
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement