Andrew Plummer

Results 205 comments of Andrew Plummer

Well it actually should be both, so I'm still curious! Essentially you should be able to do this: ```javascript Sugar.Date.minutesAgo(d); // Static new Sugar.Date(d).minutesAgo(); // Chainable Sugar.extend(); // Extend methods...

> The Date object in Sugar is just a regular Date object Well, it depends. The short version is that Sugar instance methods have 3 modes of use: 1. Static...

I'm going to close this issue for now to get it off my plate. Thanks for all the help, especially @trikadin. I may actually delve into Typescript more after this...

I've actually been using generics for this. Would this work: ```typescript isArray(instance: any): instance is Array; ``` Other generics can be derived from the ES6 typings...

> Typescript built-in es6.d.ts has the following definition for Array.isArray Ok fair enough... the rest makes sense too... Will check this out

Thank you! If possible can you keep track of it somewhere so I can repro the errors?

Ah sorry, I just meant if you can give me some code to help test the definitions I would appreciate it :)

> you shouldn't use generics for this, because argument could be non-typed array... Ok I re-read this and I think I finally understand what you mean. Unfortunately I think this...

But actually I still find this confusing... If this is correct, then why do the native `lib.es6.d.ts` typings define `interface Array` with a generic? A standard array may or may...

> For non-typed arrays you can use smth like...Or, if you have restricted subset of types... Right, but wouldn't the generic help to facilitate that? i.e. `Array.construct(...)`