No BS TS - Challenge #1

preview_player
Показать описание
Let's see if you can take on a challenge with your new Typescript superpowers.

00:00 Introduction
00:15 Challenge Introduction
01:30 Solution
09:24 Outroduction

👉 What's my theme? Night Wolf [dark blue]
👉 What's that font? MonoLisa

💢 Watch our other videos:

Thank you for watching this video, click the "SUBSCRIBE" button to stay connected with this channel.

#typescript #NoBSTS
Рекомендации по теме
Комментарии
Автор

Wherever I go,
I can't escape the GOT disappointment

JorSenpai
Автор

Great content. I can't wait to watch the rest in the playlist.

For some reason though, my brain just noped out of this challenge. Hopefully I'll do better on the next one.

captstrugglebunny
Автор

wow...I thought I was understanding everything until I got here...haha...back to the square 1

danihazler
Автор

I struggled to understand what was intended with the addition of the ID but once I got past that I got to a working solution. Less clean than the solution in the video, but hey, im learning! Loving this series

jacobharris
Автор

These videos are helping me learn typescript!! Please upload more !!

shaancodes
Автор

as I was doing this, the word House started looking waaay weird to me.

adicide
Автор

Thank you. Excellent instruction! keep up the good work!

lttaylor
Автор

in the tsconfig.json file you can enable "resolveJsonModule": true, so you can import the json file as `import housesData from "./data/houses.json";` that way is an array

kafkaphoenix
Автор

GOT reference is funny. They did blow an amazing series! Why spend 8 years building up so much and then wrap it up in a couple hours?!

DedicatedManagers
Автор

Submitted the code - took me a little while to do it but I'm happy I made it :)

noir
Автор

Jack, why we use function overloading? seems to me like we can't ignore the first 4 functions and just leave the last one, what is the adventage of using func overloading?

juanferrer
Автор

About that import of a JSON, you're actually omitting that, ... but you're doing that at the end with a ts configuration, nice..! I actually learnt it by declaring a module in a .d.ts file. (I do this for other file types too, but I hardly have any clue what that simple syntax is doing:
declare module '*.json' {
const value: Object<T>;
export = value;
})
Are you going to treat that subject as well?

jornejongsma
Автор

Hi there, I like your videos a lot, since they have a really clear way of teaching deep concepts, thank you very much for all of them. I'm a beginner and slow learner, since I go around my way testing on each new concept. I tried to test your code calling it with a string, since it was a little confusing this line :

*const houses: House[] = typeof input === 'string' ? JSON.parse(input) : input;

in my experience it doesn't work when I call it with a string, becouse houses then become an object, but not an array. Then it doesn't have the method filter, and I get the console message :

house.filter is not a function.

I called it like this:
const singleHouse = '{"name":"valquiria", "planets":"sun"}';
console.log(findHouses(singleHouse, ({ name }) => name === 'Atreides'));

how would you fix that line* of code so its converting the string into an array?
and also, why did typescript not say anything about that?
(sorry about my english, it's not my native language)

valentina
Автор

Could you explain in depth what's going on in lines 30, 31, and 32?

lttaylor
Автор

In line 32, what is the meaning of "...house, " ?

lttaylor
Автор

Hi! I don't understand what's going on on line 21 and 24. The filter function requests a type House argument, yet we are passing it a name? I see there's some kind of destructuring going on but It's still confusing to me. Any help from someone? Thanks!

Pedro-yohr
Автор

You ended up simplifying all your overloads down to one definition. Since that last definition has to be able to handle all the cases... Can’t you always simplify all the overloads down to one definition? And if that is the case… What’s the point of Overloads?

DedicatedManagers
Автор

i'm trying to figure out why there are so many functions with the same name:, I don't understand what they are there for.

succatash
Автор

+99 for that GOT comment, really disappointing.

william
Автор

Could you please share the link of the gist?

sreekar_s