Examples
Every language feature has a runnable example under examples/ — no README snippets to go stale, just .ts files that compile and run, verified on every build. All 443 of them are here, grouped by area; pick one from the tree on the left.
Arrays 21
Array BoundsArray From ArraylikeArray FunctionsArray MethodsArray Reference SemanticsArray To StringArraysArrays In ContainersArrays Of ObjectsFrom AsyncHigher OrderIndex AppendLiteral TablesMutators EverywhereNested ArraysReference AliasingReturn Capture AliasingSortSparse ElementsSpread RestUndefined Absence
assert 1
Async / Promise 15
Basics 32
Arguments ObjectArray HolesAsiBasicsBitwiseConstContinueDataviewDestructuringExponentiationFloat FormattingFor OfFunction ObjectsHexKey OrderLogical AssignmentLogical OperatorsMap Any ViewNamespacesNull Deref TypeerrorNumber MethodsOptional CallOptional ParamsOptional Params FunctypeParse FunctionsSequence OperatorSwitchTernaryUndefined NumberVar ScopeVoid OperatorWrapper Objects
BigInt 1
Blob 2
Buffer 3
child_process 3
Classes 22
Class FactoryClass Statics Per EvalClass ValuesClassesDynamic BaseError SubclassExtends ArrayExtends DateExtends FunctionExtends MapExtends NumberExtends PromiseExtends RegexpForeign ArgumentLiteral Member NamesLocal Class ClosureMixinsNew TargetSelf Ref Frozen FieldSpeciesSuper In ArrowSymbol Keyed Fields
Closures 6
cluster 3
console 4
Control flow 3
Cross Compile 1
Web Crypto 4
Date 1
Decorators 6
dgram 1
dns 2
Dynamic 8
Encoding / Text 1
Enums 1
EventEmitter 4
Events 9
EventSource 1
fetch 12
Ffi 1
Finalization 1
File system 7
fs (async) 1
Fs Promises Pool 1
fs (streams) 1
Fs Watch 1
Function expressions 8
Generators 5
Generics 6
Globals 6
Concurrency (klain:sync) 3
HTTP server 34
Async Handler Inproc ClientAsync Handler ProxyChained ListenClient Error EventClient ServerCluster Plus Extra ServerCreate Server HandleCreate Server OptionsCreate Server TimeoutsHttp Binary BodyHttp CloseHttp ClusterHttp ServerHttp Union BodyHttps ClientKeepalive And DateListen OptionsListen Port ZeroMulti ServerMulti Server H2Multi Server HttpsMulti Server UpgradeMulti Server Ws SecondaryNode CreateserverReq Pipe ResReq ReadableRes Backpressure DrainRes StreamRes Stream BackpressureRes Write BinaryRes Write Pipe InterleaveServer Close EventServer Connection EventServer Error Event