Passing Type Arguments
Here we're creating a set of guitarists and adding Jimi Hendrix and Eric Clapton to it.
const guitarists = new Set();guitarists.add("Jimi Hendrix");guitarists.add("Eric Clapton");
We also have th
0:23 We're also expecting an error to throw here when you add a non-string to that set. If I remove this, then this should be erroring here, but it's not. For some reason, our set isn't being strictly typed as a set of strings. We've got it here, too, "Should be typed as an array of strings."
0:45 When we get our guitaristsAsArray here, when we call Array.from guitarists, then it should be returning a type which is a string array, but it's not. It's saying it's unknown array. Your challenge is to figure out -- I'll give you a clue, it's on this line -- how to type this set as a set of strings and not just what it is now, which is a set unknown.