I saw this block of code in our code base and I have a bit of a problem to understand void = (page)
. According to https://stackoverflow.com/a/34274584/513413, the return type is coming after =>
which is void
in my case. So what does = (page) => {}
do?
What is its equivalent function if I don't write it with fat arrow function?
This is the code:
private navigateTo: (page: string) => void = (page) => {
// display page
}