TypeScript Interview Questions 2024 (Junior & Mid)

Поділитися
Вставка
  • Опубліковано 6 лип 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...
    ------------------------------------------------------------------------------------------

КОМЕНТАРІ • 13

  • @therealseniordev
    @therealseniordev  Місяць тому

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

  • @Caranthir23
    @Caranthir23 Місяць тому

    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 2 місяці тому

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

  • @JustinBishop-o6c
    @JustinBishop-o6c 11 днів тому +1

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

    • @therealseniordev
      @therealseniordev  9 днів тому

      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.

    • @JustinBishop
      @JustinBishop 6 днів тому

      @@therealseniordev in the intro of the video, the guy on the right says today we are "going through some senior typescript questions? thats why i was wondering why the title says "junior & mid". so would you say these are junior questions or senior because the viewer has mixed signals.

  • @elie3423
    @elie3423 Місяць тому

    you can extend a type in typescript -_-

    • @batfishh
      @batfishh 20 днів тому

      It's a new feature

  • @zandernoriega
    @zandernoriega 2 місяці тому +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  Місяць тому

      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 Місяць тому

    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 Місяць тому +7

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

    • @batfishh
      @batfishh 20 днів тому +1

      Stop crying, no one asked you to use TS