The method parameters in the Class class under Nodejs are written with colons and < T >, which is similar to generics.

I see a way of writing in other people"s blogs that makes me confused. I can"t understand it. Can you tell me what version of grammar this is in ES? I only know ES6

.

clipboard.png
instance method name followed by < T >, mapper: (doc:object) = > T): promise.. in the method parameters Two colons are concatenated to indicate that they do not understand

Mar.20,2021

this should be the syntax of typescript and requires the compilation environment corresponding to typescript. But node is not enough


keywords: static type checking TypeScript flow
if you haven't seen this syntax before, you can take a look at TypeScript
< T > search < string > () pass in type
< T > . : Promise is the type of value returned by the method

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5f9a5-4cf4a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5f9a5-4cf4a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?