Types You Don't Control 12 exercises
Problem

Configuring the lib Compiler Option

In this exercise, we have a simple operation that you might expect to work without issues.

We're working with a basic string, "Hello, World!", and we're attempting to replace all instances of "Hello" with "Goodbye" using the replaceAll method:


const str = "Hello, world!";
str.replaceAll

Loading exercise

Transcript

00:00 In this exercise, we have a string, which is hello world, and then we're trying to say string.replaceAll hello goodbye, but TypeScript is yelling at us. Property replaceAll does not exist on type hello world. Your job is to try to work out why this is happening and what we can change in our tsconfig.json

00:19 to try to make this work. There are two possible solutions that you can use in your tsconfig.json, but that is the area that you need to look at first of all, where it is just here. Good luck.