Just diving into typescript for the first time, so bear with me...
I decided to create a simple filter function for a container I had created
class Container<T> {
filter(predicate: (T) => boolean): Container<T> {
for(const element of this.contents) {
if(predicate(element))
and then tslint flagged an error about using capital letters to start variables (which is a rule I deliberately follow). Initially, I was confused, but it turns out that it was interpreting the T in (T) => boolean as a parameter name rather than the type. After doing some research on typescript callback examples, I noticed that everyone was defining a function signature like
(paramName: ParamType) => ReturnType.
However, I find the paramName in this context to be unnecessary. I'm not defining the function, just providing its signature. So, why does Typescript permit this?