Void and undefined
Last updated
Was this helpful?
Last updated
Was this helpful?
Both cases are accepted, since if no return value is specified , javascript will return undefined
A contextual function type with a void
return type (type voidFunc = () => void
), when implemented, can return any other value, but it will be ignored.
When a literal function definition has a void
return type, that function must not return anything.