5 ms·
That's TS, not JS.
by gabrielsroka 1y ago
That's TS, not JS.
- 90s_dev 1y agoFor now. https://github.com/tc39/proposal-type-annotations https://github.com/tc39/proposal-type-annotations
- jameshart 1y agoOne line of TS, then two lines of JS (with a type annotation in one of them)
- goloroden 1y agoIt’s not even 2 lines: 1. Type definition 2. Chain definition 3. Enqueue definition
- jakelazaroff 1y agoLine 1 is fully erased when transpiling, leaving two lines of JavaScript.
- Brian_K_White 1y agoBut you still had to write it and it's required to get the result, so I don't see any rational for not counting it. Transpilation does not change the fact that the input is these 3 lines of code in 2 different languages.
- jakelazaroff 1y agoRight, and only two of those lines are JavaScript. The type definition is not required to get the result.
- metadat 1y agoI noticed the same thing when I saw the code. Is it honest for TFA to title it as "2-lines of Javascript" in this case?
- dcre 1y agoOh, come on.
- egorfine 1y agoI came here to make the same comment. I wonder why are you downvoted for being as factual and neutral as it is technically possible.
- ameliaquining 1y agoI think because a reader who doesn't want to use TypeScript can trivially remove the type annotations, so they're not actually a barrier to using this code in JavaScript. Some people might also be suspicious that the reason to bring this up is to imply hostility to JavaScript tooling that requires a build step, since it's become popular to hate on this.
- egorfine 1y agoSo as a community of developers we're totally okay calling TypeScript "JavaScript" because ... mentioning that hard cold fact is a sign of hostility towards TS? Ok. Got it.