4 ms·
I was under the impression that typescript is a superset of javascript. Is that not the case?
by cheez 10y ago
I was under the impression that typescript is a superset of javascript. Is that not the case?
- rplst8 10y agoIt is. I've not written anything in it other than a few simple tutorials, so I'm not an expert, but from what I've read you can drop to straight JS in your TS source code.
- dweinus 10y agoThe title of one of the article sections is literally "TypeScript is a Superset of JavaScript" ...people do still read before commenting, right?
- cheez 10y agoJust wondering why you can't use React directly if that is the case
- iLoch 10y agoIn order for TypeScript to understand the types it is interfacing with (especially in the case of libraries) there has to be a type definition created for each library. Dismissing my complaint because "TypeScript is a superset of JavaScript" shows a lack of understanding regarding how the system works.
- abritinthebay 10y agoIt is, but that means less than most TS advocates realize. I mean Objective-C is something like 97% a superset of C... doesn't make the transition any easier.
- smt88 10y agoThere is a huge difference between 97% superset and 100% superset. JS is valid TS without changing anything. The transition is easy.
- abritinthebay 10y agoActually there is only a 3% difference. Which isn't actually that huge (most not hugely complex C programs are valid Objective-C programs, at least with a couple of minor tweaks). As I said - it's a silly marketing point that isn't convincing anyone already not convinced by TypeScript and they'd do better to drop it as a talking point.