I'm blocked by a small problem:
const foo = ["foo", "bar"]; // type "string[]"
const foundFoo = foo.find(fooEl => fooEl === "notFooBar"); // type "string" -> why not "string | undefined"
I checked the type definitions of array.find and it does say it could possibly return undefined. Why is my environment saying the the foundFoo is of type string and not string | undefined?
The only other questions regarding this on StackOverflow that I found, asked pretty much the opposite why it "could" be undefined, so I'm not sure why my environment is saying the opposite.