Take the 2-minute tour ×  how does one augment one of the
'built-in' types? eg Array?  In JS, I'd do something like
Array.prototype.shuffle = function () { ... };  what's the
equivalent in TypeScript?  share|improve this question add
comment  1 Answer  up vote 10 down vote accepted  Types are
'open ended' in TypeScript, so you can just write:  interface
Array {   shuffle: () => any; // <-- Whatever signature you
want.  And then the type is expanded to include the new function
(and you can assign a function matching the signature to it).
Note however that extending the built-in types (those in
lib.d.ts - such as Array) has an issue currently in the language
service, as it caches those internally for perf reasons. Do the
workaround I wrote-up at
http://typescript.codeplex.com/workitem/4 to extend the built-in
types without errors in the language service in VS.
share|improve this answer That workitem is now a broken link – 
uosɐſ Jan 23 '13 at 16:01 Updated workitem :
typescript.codeplex.com/workitem/176 –  b