cf.completefrontend

Predict the typesEasy

In these event listeners, why is event.target.value an error, and what type is event?

Name the type each ^? line points at, and every error TypeScript reports.

What does TypeScript report here?
const input = document.querySelector("input")!; input.addEventListener("input", function (event) {  //                                      ^?  console.log(event.target.value);  console.log(event.currentTarget.value);  console.log(this.value);  //          ^?}); input.addEventListener("keydown", (event) => {  //                               ^?  console.log(event.key);});

Work it out first: the compiler shows every error and type.

The answer

Work out every error TypeScript reports and every type it shows, line by line. Then check.

Checking your sign-in…