Re: Re: Proposal: Math.add, Math.sub

2019-05-12 Thread Vic99999
>const sum = array.reduce(Math.add); It is better not to do this... because the Array#reduce passed 4 parameters to callback. >array.sort((a, b) => a - b); This comparator will not give you a good result when the platform does not support denormalized numbers, as the difference 2.225073858507202e-3

Re: something wrong about generator

2018-05-06 Thread Vic99999
>or it need to return {value: {value: "end", done: true}, done: true} this case is supported, seems, if to use: function* b() { return yield* a() } ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Roman numeral support in Number type

2017-07-06 Thread Vic99999
Roman numerals are already supported by ECMAScript Internationalization API Specification:Try in Safari Browse:```new Intl.NumberFormat("it-u-nu-roman").format(10);```  ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/e

{}+{} incosistency

2016-04-13 Thread Vic99999
if "{}+{}" is a statement, than how can it return (or yield) a result? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: stable sort proposal

2016-03-15 Thread Vic99999
> What about the Timsort? I cannot believe it will be faster on random int array. And TimSort is base on MergeSort and, seems, for it's worst cases it cannot be better than MergeSort. I have tried https://github.com/mziccard/node-timsort/ with my old node.js - 0.10.4 and Chrome 49 (win32) - and

Re: stable sort proposal

2016-03-14 Thread Vic99999
@Tab Atkins Jr., The only question is how much slower/more expensiver stable sorting is than unstable sorting, and whether that cost is sufficient to outweigh the usefulness of a stable sort. My own experiment shows, that QuickSort (unstable) is ~20% (or more) faster on "random" array of intege

Re: stable sort proposal

2016-03-13 Thread Vic99999
>  `arr.indexOf(arguments[0]) - arr.indexOf(arguments[1])` This will work only if `arr` is a copy of an array which you are trying to sort, because the algorithm may swap those elements and so reposition them relative to other elements ... Stable sort is useful sometimes, but it is possible to

Re: Re: SameValueZero comparator and compatibility

2014-02-03 Thread Vic99999
> There was a SpiderMonkey bug1, and even a patch, for this for quite a while. > The patch now landed and will be in Firefox 29. >V8 got fixed last week too >code.google.com/p/v8/issues/detail?id=3069 but according to spec, "forEach" should call callback with "-0": var map = new Map(); map.set