Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

352
Vistas
Clarification about data type overloading (Union Types)

Actually I saw a line of code on router.d.ts, like

isActive(url: string | UrlTree, exact: boolean): boolean;

Then I quickly learn about it and getting some knowledge about Union Types in typescript

So I tried it to implement on my application instead of using Any

Statement 1

function(param: string | number) {    
}

Statement 2

function(param: any) {    
}

I understood my statement 1 is pretty good for limiting data type count from using any (or instead of using any)


But I know typescript is an type safe scripting language. But what about type safe is an possible, if we override datatype's? and share your more knowledge about it.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda