TypeScript Interview Questions 2024 (Junior & Mid)

Sdílet
Vložit
  • čas přidán 28. 06. 2024
  • ------------------------------------------------------------------------------------------
    👇🏼 HOW WE CAN HELP YOU
    🤔 Find Your Technical Gaps With This FREE 10-Minute Technical Assessment
    learn.theseniordev.com/techni...
    🚀 Get Rid Of Impostor Syndrome And Fast-track To Senior Level
    learn.theseniordev.com/free-tr...
    ------------------------------------------------------------------------------------------

Komentáře • 12

  • @therealseniordev
    @therealseniordev  Před měsícem

    🔍 Find your technical gaps with this Free Technical Assessment: www.theseniordev.com/free-technical-assessment

  • @Caranthir23
    @Caranthir23 Před měsícem

    I would add to `as const` that it narrows the type as much as possible:
    const obj0: { a: number, b: string } = { a: 1, b: 's1' };
    const obj1: { readonly a: 1, readonly b: 's1' } = { a: 1, b: 's1' };

  • @shunaamtaran9672
    @shunaamtaran9672 Před 2 měsíci

    Hey man! Do you need any help with editing and Thumbnail?

  • @JustinBishop-o6c
    @JustinBishop-o6c Před 3 dny +1

    these are senior questions but the title is clickbait saying junior????

    • @therealseniordev
      @therealseniordev  Před 13 hodinami

      From our experience those questions are mostly midlevel / junior - we will make a Senior TypeScript video soon. This is due to the increase competition in the market in the last years, where a lot of midlevel position are requiring what a senior position used to.

  • @elie3423
    @elie3423 Před 26 dny

    you can extend a type in typescript -_-

  • @zandernoriega
    @zandernoriega Před měsícem +1

    The answer to the first question, and the example given, are pretty bad.
    It explains neither what generics are nor why they're useful.
    A better answer would be something like:
    Generic functions are functions that are meant to have logic that should work with *literally every type*.
    However, you don't want to use `any`, *because any loses type information*.
    So instead of `any`, you pass *types as parameters* (ie. parametric polymorphism, not ad-hoc polymorphism) so the compiler doesn't lose type information.
    Example: The identity function. Clearly, it should work with all types, since it does nothing but return the argument. Ie.: `id(x) == x` for all types. Using `any` would lose type information, therefore it's better to define it as `function id(x: T): T { return x }` which allows the compiler to preserve the type information.

    • @therealseniordev
      @therealseniordev  Před měsícem

      that's quite on spot Zander, yes Bogdan kind of "flyed" through the answer as we had to fit all those question in one video, in a second series we aim to go much deeper, thank you so much for the feedback

  • @andrewwall2730
    @andrewwall2730 Před měsícem

    Why I hate typescript. Leave javascript alone and stop trying to make it a typed language when it is not. If you are a skilled JS developer you don't need this crap, because it will still not catch runtime errors and just bloats the code. Just learn about guards and typeof and you can make your code runtime safe. JUST STOP TRYING TO MAKE JAVASCRIPT LIKE JAVA!!! And the proper name is ecmascipt.which was written in 13 days, named livescript by Branded Eich in tthe late '90s. As an aside Typescript is an MS tool, and I hate just about anything to do with MS

    • @andrewfritz3673
      @andrewfritz3673 Před měsícem +6

      You don't have to use it! Keep on chugging with Vanilla JS if you're so upset. Good Lord.

    • @batfishh
      @batfishh Před 11 dny +1

      Stop crying, no one asked you to use TS