Template Literals 7 exercises

Transform String Literals To Uppercase

Similar to the last exercise, we will be working with template literals to create an object.

We'll start with Event, which is a a set of string unions, as well as an unknown ObjectOfKeys.

type Event = `log_in` | "log_out" | "sign_up"
type ObjectOfKeys = unknown


Your ch

Loading exercise


0:00 In this exercise, we have another set of string unions, where we have log_in, log_out, sign_up. We want to create an object based on, very similar to the previous exercise, actually. They're all going to be strings, the values.

0:14 We want to turn these keys into their uppercase counterpart. log_in is going to be LOG_IN with uppercase. You have to find a way, pretty similarly to the previous exercise, of mapping through these and creating objects out of them, but also transforming the key and turning it into its uppercase counterpart.