DEV Community

Discussion on: Developing an Express Application Using TypeScript

Collapse
 
heritiermwalila profile image
Heritier Mwalila

@edwin , this is very easy to understand if you already understand type of interface in typescript
You can write the same thing like this
interface arg{
(ar)=>void
}
interface middlewareInter{
forEach:(argument:arg)=>void // look at forEach function in js how it written
}
private middlewares(middlew:middlewareInter){
}

it return void because don't wanna handle the result there. void is a type in typescript which just tell that the function does not return anything