Re: Add an easier method for slicing and stepping strings and arrays

2017-07-26 Thread Isiah Meadows
That, I could support. On Wed, Jul 26, 2017, 16:38 Alexander Craggs wrote: > In which case, perhaps change this proposal to .slice(start, end, step) > ___ > es-discuss mailing list > es-discuss@mozilla.org >

Re: Re: Add an easier method for slicing and stepping strings and arrays

2017-07-24 Thread Jordan Harband
Array slice already allows negative indexes. `arr.slice(-1)[0]` works fine for a quick and dirty "last item". On Mon, Jul 24, 2017 at 3:19 PM, Tab Atkins Jr. wrote: > On Sun, Jul 23, 2017 at 12:36 AM, Darien Valentine > wrote: > > Here are some

Re: Re: Add an easier method for slicing and stepping strings and arrays

2017-07-24 Thread Tab Atkins Jr.
On Sun, Jul 23, 2017 at 12:36 AM, Darien Valentine wrote: > Here are some related threads from the past: > > https://esdiscuss.org/topic/negative-indices-for-arrays > https://esdiscuss.org/topic/array-slice-syntax >

Re: Re: Add an easier method for slicing and stepping strings and arrays

2017-07-23 Thread Dante Federici
This feels like an attempt to get toward python's style of slice . Which I'm not opposed to, and would like to hear how it's better than just the method. ___ es-discuss mailing list

Re: Re: Add an easier method for slicing and stepping strings and arrays

2017-07-23 Thread Darien Valentine
Here are some related threads from the past: https://esdiscuss.org/topic/negative-indices-for-arrays https://esdiscuss.org/topic/array-slice-syntax https://esdiscuss.org/topic/javascript-language-feature-idea I think I’ve seen it mentioned a few other times too. The `arr[-1]` syntax is a