Estadísticas del código: Obtener el tipo nativo de un valor o variable - JavaScript

Imágen de perfil
Val: 2.288
Plata
Ha mantenido su posición en JavaScript (en relación al último mes)
Gráfica de JavaScript

Obtener el tipo nativo de un valor o variable


JavaScript

Publicado el 12 de Marzo del 2020 por Katas (200 códigos)
855 visualizaciones desde el 12 de Marzo del 2020
Función que devuelve el nombre del constructor de un valor o variable dada.

1
2
3
4
5
6
7
8
9
getType(3);          // Number
getType("");         // String
getType([]);         // Array
let x=new Set()
getType(x);          // Set
let x=new Date()
getType(x);          // Date
getType();           // undefined
getType(null);       // null

46 visualizaciones durante los últimos 90 días


8
0