Transcript
00:00 So the actual solution here is not very tricky, or at least it's not a lot of lines of code. So what we need to do is get the type of the operator, and, or operations, operations, there we go. And then we're gonna do the key of that. Okay, so maybe this is like, hold on, what's going on?
00:20 So let's extract this. We're gonna make a type of operation, or operations, and then we're going to do the type is operation, so the different operation possibilities. And so that's gonna get us our plus minus multiply divide, and then we stick that in here.
00:38 So this is basically just a short version of that. And so what that means is, if I hover over operator, we're gonna see those are the possible values, and if I do decide to add a exponentiation operator there, then I can 100% do it right there. TypeScript's not mad, I'm not mad, the browser's not mad,
00:58 everybody's happy, we're all happy. And all because now we're deriving this, and so we can add as many other operations as we want. Now we can do modulus, and modulus that, there you go. Kind of fun and interesting stuff, and it's all just derived out of this operations object.
01:18 Pretty cool.