Can someone explain the difference between:
function foo(bar: ?string) { console.log(bar); }
and:
function foo(bar?: stri
?string (maybe type) means that bar property can be string aswell as null and void.
?string
bar
string
null
void
bar? means that this property is optional.
bar?
More info: https://flow.org/en/docs/types/primitives/