Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

208
Visualizações
is typescript truly strict?

I am new to typescript so this may be a dumb question or a odd question, which I don't doubt that it is, but please look at this example of what I mean:

typescript

var num:number = 5
console.log(num)

compiled to js:

"use strict";
var num = 5;
console.log(num);

in the compiled code there is not anything really restricting num from being anything but a number. So, is typescript really strict? Or is it just creating the allusion of being strict? Or perhaps is there a option in the tsconfig.json that is suppose to make the code strict that I missed?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

TypeScript tries to guarantee types at compile time, at runtime everything is dynamic. So if you communicate with an API and type it using TypeScript but the API delivers something else, then the "illusion", as you called it, will break.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda