score:6

this is not part of es6 syntax. you're looking at type definitions for static type checkers, such as flowjs or typescript. there is no es5 syntax for that.

score:7

that is typescript and it is annotating what type of value the function returns. getinitialstate returns a number.

you can see the same annotation in the arguments being passed to reduce(). this sort of annotation lets your ide/text editor do some really helpful suggestions and error checking.


Related Query

More Query from same tag