[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

Javascript Object Extensions Updated

Simon Blackwell

1/7/2016 10:29:00 PM

Javascript Object Extensions is a browser and Node.js library that adds missing and convenience functions and properties to Number, String, Boolean, Date, Array and Set.

It adds lt, lte, eq, neq, gte, gt to Number, String, Boolean, Date. Dates can be compared with precision, e.g. *.lt(date,"Y")*.

Between and outside are added to Number and String.

For language processing apps the useful functions soundex and echoes are added to String.

The methods isLeapYear and getLastDayOfMonth are added to Date as well as properties for year, fullYear, month, etc. Joex also adds data members to represent all of the parts of a Date so that they can be treated in a declarative manner.

Intersection, intersects, disjoint, coincident, crossproduct, min, max, avg are added to to Array and Set. And, some, every, and toJSON are added to Set. toJSON results in an array like representation.

Available at https://github.com/anywhic... and via https://www.npmjs.com/pa...
23 Answers

Evolution

10/4/2008 5:29:00 PM

0

Greg Weber wrote:
> On Fri, 3 Oct 2008 21:21:57 -0500, cwb wrote
> (in article
> <5dcd67f5-d5da-472b-a876-305dc5dac2d9@e53g2000hsa.googlegroups.com>):
>
>> On Oct 3, 12:07 pm, Tom Poynton <tom.poyn...@googlemail.com> wrote:
>>> I have to say I'd rather hear Veedon Fleece myself, but it should be
>>> good. Lets hope the Caledonian Souls Orchestra are there ;-)
>>>
>>> Tom
>>> ----------------------------------------------------------------------------
>>>
>>> http://www.nme.com/news/van-morr...
>>>
>>> NME News
>>>
>>> He'll be joined by 'Astral Weeks' original musicians at Hollywood Bowl
>>>
>>> Oct 3, 2008
>>>
>>> Van Morrison is set to play his legendary 1968 album 'Astral Weeks' in
>>> its entirety in Los Angeles next month.
>>>
>>> The singer will be joined by some of the original musicians who
>>> performed on the album at the two Hollywood Bowl performances on
>>> November 7 and 8, reports Billboard.
>>>
>> wow! never saw this coming...
>
> The Sistah -- "If I had unlimited funds and time, I'd go to that."
>
> I may be eating cat food for a few months.
>
> --Fr, G.
> Astral-Weeks, WI
>

Wow, I just tried to get tickets in the pre-sale, and they are $255 each
plus fees! Guess I don't want to see this that bad...

Laurie

Michael Haufe (\"TNO\")

1/7/2016 10:45:00 PM

0

On Thursday, January 7, 2016 at 4:29:25 PM UTC-6, Simon Blackwell wrote:
> Javascript Object Extensions is a browser and Node.js library that adds missing and convenience functions and properties to Number, String, Boolean, Date, Array and Set.
>
> It adds lt, lte, eq, neq, gte, gt to Number, String, Boolean, Date. Dates can be compared with precision, e.g. *.lt(date,"Y")*.
>
> Between and outside are added to Number and String.
>
> For language processing apps the useful functions soundex and echoes are added to String.
>
> The methods isLeapYear and getLastDayOfMonth are added to Date as well as properties for year, fullYear, month, etc. Joex also adds data members to represent all of the parts of a Date so that they can be treated in a declarative manner.
>
> Intersection, intersects, disjoint, coincident, crossproduct, min, max, avg are added to to Array and Set. And, some, every, and toJSON are added to Set. toJSON results in an array like representation.
>
> Available at https://github.com/anywhic... and via https://www.npmjs.com/pa...

"The disadvantages of Javascript polyfills":
<http://adamsilver.io/articles/the-disadvantages-of-javascript-poly...

Aleksandro

1/8/2016 12:37:00 AM

0

On 07/01/16 19:45, Michael Haufe (TNO) wrote:
> On Thursday, January 7, 2016 at 4:29:25 PM UTC-6, Simon Blackwell wrote:
>> Javascript Object Extensions is a browser and Node.js library that adds missing and convenience functions and properties to Number, String, Boolean, Date, Array and Set.
>>
>> It adds lt, lte, eq, neq, gte, gt to Number, String, Boolean, Date. Dates can be compared with precision, e.g. *.lt(date,"Y")*.
>>
>> Between and outside are added to Number and String.
>>
>> For language processing apps the useful functions soundex and echoes are added to String.
>>
>> The methods isLeapYear and getLastDayOfMonth are added to Date as well as properties for year, fullYear, month, etc. Joex also adds data members to represent all of the parts of a Date so that they can be treated in a declarative manner.
>>
>> Intersection, intersects, disjoint, coincident, crossproduct, min, max, avg are added to to Array and Set. And, some, every, and toJSON are added to Set. toJSON results in an array like representation.
>>
>> Available at https://github.com/anywhic... and via https://www.npmjs.com/pa...
>
> "The disadvantages of Javascript polyfills":
> <http://adamsilver.io/articles/the-disadvantages-of-javascript-poly...

I stopped reading when I saw Thomas Lahn in the list of ?experts?.

JR

1/8/2016 1:44:00 AM

0

On 7 January 2016 22:37:33 UTC-2, Aleksandro wrote:
> On 07/01/16 19:45, Michael Haufe (TNO) wrote:

> >
> > "The disadvantages of Javascript polyfills":
> > <http://adamsilver.io/articles/the-disadvantages-of-javascript-poly...
>
> I stopped reading when I saw Thomas Lahn in the list of "experts".

This Adam Silver cannot be serious. For a moment, I thought I was reading Adam Sandler.

--
Joao Rodrigues

Michael Haufe (\"TNO\")

1/8/2016 2:03:00 AM

0

On Thursday, January 7, 2016 at 6:37:33 PM UTC-6, Aleksandro wrote:
> On 07/01/16 19:45, Michael Haufe (TNO) wrote:

> > "The disadvantages of Javascript polyfills":
> > <http://adamsilver.io/articles/the-disadvantages-of-javascript-poly...
>
> I stopped reading when I saw Thomas Lahn in the list of "experts".

I understand. The article has a bit of a learning curve once you decide to scroll the page.

Simon Blackwell

1/9/2016 1:55:00 PM

0

On Thursday, January 7, 2016 at 5:45:18 PM UTC-5, Michael Haufe (TNO) wrote:
> On Thursday, January 7, 2016 at 4:29:25 PM UTC-6, Simon Blackwell wrote:
> > Javascript Object Extensions is a browser and Node.js library that adds missing and convenience functions and properties to Number, String, Boolean, Date, Array and Set.
> >
> > It adds lt, lte, eq, neq, gte, gt to Number, String, Boolean, Date. Dates can be compared with precision, e.g. *.lt(date,"Y")*.
> >
> > Between and outside are added to Number and String.
> >
> > For language processing apps the useful functions soundex and echoes are added to String.
> >
> > The methods isLeapYear and getLastDayOfMonth are added to Date as well as properties for year, fullYear, month, etc. Joex also adds data members to represent all of the parts of a Date so that they can be treated in a declarative manner.
> >
> > Intersection, intersects, disjoint, coincident, crossproduct, min, max, avg are added to to Array and Set. And, some, every, and toJSON are added to Set. toJSON results in an array like representation.
> >
> > Available at https://github.com/anywhic... and via https://www.npmjs.com/pa...
>
> "The disadvantages of Javascript polyfills":
> <http://adamsilver.io/articles/the-disadvantages-of-javascript-poly...

I can only presume this is an objection to this library since there were no comments. I am fully aware of the danger of polyfills and will update the README of the libary to point to the referenced article. That being said, I hold there are cases where polyfills may be the only choice, i.e. where instanceof semantics must be preserved or major portions of existing code will have to be re-written (introducing yet another set of risks). This library was designed in such a way that the programmer has the ability to select which polyfills to use and can take the risks in an informed manner.

Simon Blackwell

1/9/2016 2:12:00 PM

0

On Saturday, January 9, 2016 at 8:55:26 AM UTC-5, Simon Blackwell wrote:
> On Thursday, January 7, 2016 at 5:45:18 PM UTC-5, Michael Haufe (TNO) wrote:
> > On Thursday, January 7, 2016 at 4:29:25 PM UTC-6, Simon Blackwell wrote:
> > > Javascript Object Extensions is a browser and Node.js library that adds missing and convenience functions and properties to Number, String, Boolean, Date, Array and Set.
> > >
> > > It adds lt, lte, eq, neq, gte, gt to Number, String, Boolean, Date. Dates can be compared with precision, e.g. *.lt(date,"Y")*.
> > >
> > > Between and outside are added to Number and String.
> > >
> > > For language processing apps the useful functions soundex and echoes are added to String.
> > >
> > > The methods isLeapYear and getLastDayOfMonth are added to Date as well as properties for year, fullYear, month, etc. Joex also adds data members to represent all of the parts of a Date so that they can be treated in a declarative manner.
> > >
> > > Intersection, intersects, disjoint, coincident, crossproduct, min, max, avg are added to to Array and Set. And, some, every, and toJSON are added to Set. toJSON results in an array like representation.
> > >
> > > Available at https://github.com/anywhic... and via https://www..npmjs.com/package/joex
> >
> > "The disadvantages of Javascript polyfills":
> > <http://adamsilver.io/articles/the-disadvantages-of-javascript-poly...
>
> I can only presume this is an objection to this library since there were no comments. I am fully aware of the danger of polyfills and will update the README of the libary to point to the referenced article. That being said, I hold there are cases where polyfills may be the only choice, i.e. where instanceof semantics must be preserved or major portions of existing code will have to be re-written (introducing yet another set of risks). This library was designed in such a way that the programmer has the ability to select which polyfills to use and can take the risks in an informed manner.

The README has been uodated to say:

"Note, there are risks in using polyfills as documented here: http://adamsilver.io/articles/the-disadvantages-of-javascript-.... However, we have found there are cases where facades and wrappers will not work, making polyfills or subclassing the only choice, i.e. where instanceof semantics must be preserved or major portions of existing code will have to be re-written (introducing yet another set of risks). We attempted to develop the library using subclassing; however, the Chrome engine does some internal checking on instances before method invocation and we were getting errors related to generic function calls and instances not being of the correct type. We will continue to endeavor to enhance this library so that it does not compel the use of a polyfill so that all choice is in the end developer's hands. Meanwhile, the library was designed in such a way that the programmer has the ability to select which polyfills to use and can take the risks in an informed manner."

Aleksandro

1/9/2016 3:27:00 PM

0

On 09/01/16 11:12, Simon Blackwell wrote:
> On Saturday, January 9, 2016 at 8:55:26 AM UTC-5, Simon Blackwell wrote:
>> On Thursday, January 7, 2016 at 5:45:18 PM UTC-5, Michael Haufe (TNO) wrote:
>>> On Thursday, January 7, 2016 at 4:29:25 PM UTC-6, Simon Blackwell wrote:
>>>> Javascript Object Extensions is a browser and Node.js library that adds missing and convenience functions and properties to Number, String, Boolean, Date, Array and Set.
>>>>
>>>> It adds lt, lte, eq, neq, gte, gt to Number, String, Boolean, Date. Dates can be compared with precision, e.g. *.lt(date,"Y")*.
>>>>
>>>> Between and outside are added to Number and String.
>>>>
>>>> For language processing apps the useful functions soundex and echoes are added to String.
>>>>
>>>> The methods isLeapYear and getLastDayOfMonth are added to Date as well as properties for year, fullYear, month, etc. Joex also adds data members to represent all of the parts of a Date so that they can be treated in a declarative manner.
>>>>
>>>> Intersection, intersects, disjoint, coincident, crossproduct, min, max, avg are added to to Array and Set. And, some, every, and toJSON are added to Set. toJSON results in an array like representation.
>>>>
>>>> Available at https://github.com/anywhic... and via https://www.npmjs.com/pa...
>>>
>>> "The disadvantages of Javascript polyfills":
>>> <http://adamsilver.io/articles/the-disadvantages-of-javascript-poly...
>>
>> I can only presume this is an objection to this library since there were no comments. I am fully aware of the danger of polyfills and will update the README of the libary to point to the referenced article. That being said, I hold there are cases where polyfills may be the only choice, i.e. where instanceof semantics must be preserved or major portions of existing code will have to be re-written (introducing yet another set of risks). This library was designed in such a way that the programmer has the ability to select which polyfills to use and can take the risks in an informed manner.
>
> The README has been uodated to say:
>
> "Note, there are risks in using polyfills as documented here: http://adamsilver.io/articles/the-disadvantages-of-javascript-.... However, we have found there are cases where facades and wrappers will not work, making polyfills or subclassing the only choice, i.e. where instanceof semantics must be preserved or major portions of existing code will have to be re-written (introducing yet another set of risks). We attempted to develop the library using subclassing; however, the Chrome engine does some internal checking on instances before method invocation and we were getting errors related to generic function calls and instances not being of the correct type. We will continue to endeavor to enhance this library so that it does not compel the use of a polyfill so that all choice is in the end developer's hands. Meanwhile, the library was designed in such a way that the programmer has the ability to select which polyfills to use and can take the risks in an informed manner."

I'd say that blog post lacks way too many examples, use cases and
serious studies to be called anything close to documentation.
That's more in the line of:
X is not perfect so Y, which I personally like, must be used always.
Proof:
X fails in one example.

Evertjan.

1/9/2016 4:22:00 PM

0

Aleksandro <aleksandro@gmx.com> wrote on 09 Jan 2016 in comp.lang.javascript:

> I'd say that blog post lacks way too many examples
[..] to be called anything close to documentation

How can something "lack too many"?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Aleksandro

1/9/2016 4:32:00 PM

0

On 09/01/16 13:22, Evertjan. wrote:
> Aleksandro <aleksandro@gmx.com> wrote on 09 Jan 2016 in comp.lang.javascript:
>
>> I'd say that blog post lacks way too many examples
> [..] to be called anything close to documentation
>
> How can something "lack too many"?

Too mary more are needed, makes sense? :P