Timeline for Tips for Golfing in ECMAScript 6 and above
Current License: CC BY-SA 3.0
16 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 29, 2019 at 15:32 | review | Suggested edits | |||
Mar 29, 2019 at 17:02 | |||||
Apr 29, 2017 at 15:45 | comment | added | user58826 |
x.indexOf(y)=>0 => x.includes(y)
|
|
Apr 18, 2017 at 17:32 | comment | added | user58826 |
a.split("-") => a.split`-`
|
|
Feb 16, 2016 at 1:25 | comment | added | Neil |
As well as .map , recursion is another technique that can sometimes help you turn a for loop into an expression.
|
|
Oct 23, 2015 at 18:54 | comment | added | GamrCorps | "Joined the site a week back" - 21.4k rep... | |
Aug 31, 2015 at 5:57 | comment | added | edc65 |
+1 for Arrow function and loops . I use these tricks but I could not explain that so clearly
|
|
Feb 20, 2015 at 2:52 | history | wiki removed | Doorknob | ||
Feb 4, 2015 at 9:26 | comment | added | Claudia | With regards to the instance methods allowing mutability, I was specifically addressing this: "Note that if you want to change the same array that you are mapping over, it will fail." | |
Feb 4, 2015 at 9:19 | comment | added | Optimizer |
@impinball oh yeah. While that is true, the purpose of that example is to show the usage of , and how to club multiple statements. I just chose map randomly.
|
|
Feb 4, 2015 at 9:19 | comment | added | Claudia | @Optimizer The Array prototype methods. map, filter, reduce, forEach, every, some, etc. | |
Feb 4, 2015 at 9:18 | comment | added | Claudia |
(a=b,a.map(d)) can be further shortened to (a=b).map(d) , because the assignment returns the original value.
|
|
Feb 4, 2015 at 9:16 | comment | added | Optimizer | @impinball which instance methods ? | |
Feb 4, 2015 at 9:14 | comment | added | Claudia | You can modify the original array with the instance methods. The second is the current index, and the third is the array being iterated. | |
Sep 29, 2014 at 22:04 | history | edited | Optimizer | CC BY-SA 3.0 |
added 64 characters in body
|
Sep 29, 2014 at 21:20 | history | edited | Optimizer | CC BY-SA 3.0 |
added 671 characters in body
|
Sep 12, 2014 at 22:17 | history | answered | Optimizer | CC BY-SA 3.0 |