Current section: TypeScript 59 exercises
Problem

Reduce Duplication

Loading exercise

Transcript

00:00 Okay, this step doesn't really have anything to do with react, but I just can't leave you here With what we have I think we could do better and the thing that we can do better is All of this I do not think I should have to do that I think that should be derived because the only thing we ever pass is a number left and a number, right?

00:21 All of our operations are going to be doing that and so it's annoying to me that I have to specify The number and the return type and all of that stuff So your job is to make it so that This can be done So that we can add as many operations if we want we don't have to add the types for the function And this is totally a possible thing

00:41 This first step is going to make some aspects of what we've done so far a little more frustrating And then we'll fix that in the next step But if you're just here to learn like how do I use typescript with react? I don't really care about going too deep on typescript You can feel free to skip this one because this has nothing to do with react and typescript

01:01 This is just like typescript stuff So we're going a little bit deeper on the typescript stuff than you typically go in a react app But this is it's reasonably close to what I typically do in react apps But yeah again has nothing to do with react so hopefully this is a fun and interesting one for you

01:21 you can follow the instructions and check out the The resources and whatnot and hopefully that will guide you in accomplishing this task good luck