text:
Tips for Golfing in ECMAScript 6 and above
This is similar to other "Tips for golfing in <...>" but specifically targeting the newer features in JavaScript brought up in ECMAScript 6 and above.
JavaScript inherently is a very verbose language, function(){}, .forEach(), converting string to array, array-like object to array, etc, etc are super bloats and not healthy for Golfing.
ES6+, on the other hand, has some super handy features and reduced footprint. x=>y, [...x], etc. are just some of the examples.
Please post some nice tricks that can help shave off those few extra bytes from your code.
NOTE: Tricks for ES5 are already available in Tips for golfing in JavaScript; answers to this thread should focus on tricks only available in ES6 and other future ES versions.
However, this thread is also for users who currently golf using ES5 features. Answers may also contain tips to help them understand and map ES6 features to their style of ES5 coding.

Spread operator ...
The spread operator transforms an array value into a comma separated list.
Use case 1:
Directly use an array where a function expects a list
list=[1,2,3]
x=Math.min(...list)
list=[10,20], a.push(...list) // similar to concat()

Use case 2:
Create an array literal from an iterable (typically a string)
[...'buzzfizz'] // -> same as .split('')

Use case 3:
Declare a variable number of arguments for a function
F=(...x) => x.map(v => v+1)
// example: F(1,2,3) == [2,3,4]

See mozilla doc

Now I have a downvote here. Obviously someone noted something terribly wrong in this tip, being too shy to leave a comment and explain what ...

It looks alright. Maybe it was the lack of semicolons? ;) (btw, you can also use it as rest parameters, like splats in Ruby)

You could add that it also has a use case in function signatures :)

Misclick did not mean to downvote

@StanStrum it happens. I'll make a small update to this post so you can eventually change your vote (or you already did?)

@FelixDombek done

Maybe the downvoter was mislead by the “TypeError: values is not iterable” thrown when trying to run Use case 1 in global space. I think in such cases it refers to Object.values(), but works fine inside a closure. I would suggest to rename that variable in your example.

@manatwork don't see what you mean, I tried use case 1 in console with Firefox, Chrome and Edge. It works perfectly

Seems to be Firefox related https://i.stack.imgur.com/S4kPX.png In Chromium indeed works everywhere.

Could you please try  var values ... to see if that works? Thanks for your time @manatwork

Nope. This time is really weird: https://i.stack.imgur.com/o0AMa.png

Let us continue this discussion in chat.

@edc65 I did, yes

Using property shorthands
Property shorthands allow you to set variables to an arrays' values:
a=r[0];b=r[1] // ES5
[a,b]=r       // ES6 - 6 bytes saved

This can also be used like:
a=r[0],b=r[2] // ES5
[a,,b]=r      // ES6 - 5 bytes saved

You can even use this to reverse variables:
c=a,a=b,b=c // ES5 - uses extra variable
[b,a]=[a,b] // ES6 - not shorter, but more flexible

You can also use this to shorten slice() functions.
z = [1, 2, 3, 4, 5];

a=z.slice(1) // a = [2,3,4,5]; ES5
[,...a]=z    // a = [2,3,4,5]; ES6

Base conversions
ES6 provides a much shorter way to convert form Base-2 (binary) and Base-8 (octal) to decimal:
0b111110111 // == 503
0o767       // == 503

+ can be used to convert a binary, octal or hex string to a decimal number. You can use 0b, 0o, and 0x, for binary, octal, and hex respectively.:
parseInt(v,2) // ES5
+('0b'+v)     // ES6 - 4 bytes saved; use '0o' for octal and '0x' for hex
'0b'+v-0      // Shorter, but may not work in all cases
              // You can adapt this your case for better results

If you are using this > 7 times, then it will be shorter to use parseInt and rename it:
(p=parseInt)(v,2)

Now p can be used for parseInt, saving you many bytes over the long run.

The base conversion trick is nice, but its more likely that the conversion number would be in a form of a variable instead of a literal, in which case, it becomes much longer.

'0x'+v-0 is even shorter, but may not work as well in some scenarios.

By the way, 0767 (ES5) is shorter than the 0o767 (ES6) notation.

@CamiloMartin 0767 is a non-standard extension, and it's explicitly forbidden in strict mode.

@Oriol strict mode was a bad meme. It didn't help performance, didn't really force you to write good code, and would never become the default anyway. 0-prefixed octal literals aren't going anywhere, and are as valid ecmascript as 0o.

@CamiloMartin Strict mode helps performance, for example by explicitly forbidding caller property on functions, which allows tail call optimizations. It also helps writing better code, like preventing implicit globals. It's the default mode in class and module code. And LegacyOctalIntegerLiterals are only defined in an annex as an optional extension for non-strict mode on web browsers, that's not standard at all, unlike OctalIntegerLiterals.

Tricks learned here since I joined
My primary programming language is JS and mostly ES6. Since I joined this site a week back, I have learned a lot of useful tricks from fellow members. I am combining some of those here. All credits to community.
Arrow functions and loops
We all know that arrow functions save a lot of byts
function A(){do something} // from this
A=a=>do something // to this

But you have to keep in mind a few things

Try to club multiple statements using , i.e. (a=b,a.map(d)) - Here, the value which is returned is the last expression a.map(d)
if your do something part is more than one statement, then you need to add the surrounding {} brackets.
If there are surrounding {} brackets, you need to add an explicit return statement.

The above holds true a lot of times when you have loops involved. So something like:
u=n=>{for(s=[,1,1],r=[i=1,l=2];c=l<n;i+=!c?s[r[l++]=i]=1:1)for(j of r)c-=j<i/2&s[i-j];return n>1?r:[1]}

Here I am wasting at least 9 characters due to the return. This can be optimized.

Try to avoid for loops. Use .map or .every or .some instead. Note that if you want to change the same array that you are mapping over, it will fail.
Wrap the loop in a closure arrow function, converting the main arrow function as single statement.

So the above becomes:
u=n=>(s=>{for(r=[i=1,l=2];c=l<n;i+=!c?s[r[l++]=i]=1:1)for(j of r)c-=j<i/2&s[i-j]})([,1,1])|n>1?r:[1]

removed characters: {}return
added characters:   (){}>|
Note how I call the closure method, which correctly populates the variable n and then since the closure method is not returning anything (i.e. returning undefined), I bitwise or it and return the array n all in a single statement of the outer arrow function u
Commas and semicolons
Avoid them what so ever,
If you are declaring variables in a loop, or like mentioned in the previous section, using , separated statements to have single statement arrow functions, then you can use some pretty nifty tricks to avoid those , or ; to shave off those last few bytes.
Consider this code:
r=v=>Math.random()*100|0;n=r();m=r();D=v=>A(n-x)+A(m-y);d=0;do{g();l=d;d=D();....

Here, I am calling a lot of methods to initialize many variables. Each initialization is using a , or ;. This can be rewritten as:
r=v=>Math.random()*100|0;n=r(m=r(d=0));D=v=>A(n-x)+A(m-y);do{d=D(l=d,g());....

Note how I use the fact that the method does not bother the variable passed to it and use that fact to shave 3 bytes.
Misc
.search instead of .indexOf
Both give the same result, but search is shorter. Although search expects a Regular Expression, so use it wisely.
`Template Strings`
These are super handy when you have to concat one or more string parts based on certain conditions.
Take the following example to output a quine in JS
(f=x=>alert("(f="+f+")()"))()

vs.
(f=x=>alert(`(f=${f})()`))()

In a template string, which is a string inside two backquotes (`), anything inside a ${ } is treated as a code and evaluated to insert the resulting answer in the string.
I'll post a few more tricks later. Happy golfing!

You can modify the original array with the instance methods. The second is the current index, and the third is the array being iterated.

@impinball which instance methods ?

(a=b,a.map(d)) can be further shortened to (a=b).map(d), because the assignment returns the original value.

@Optimizer The Array prototype methods. map, filter, reduce, forEach, every, some, etc.

@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.

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."

+1 for Arrow function and loops. I use these tricks but I could not explain that so clearly

"Joined the site a week back" - 21.4k rep...

As well as .map, recursion is another technique that can sometimes help you turn a for loop into an expression.

a.split("-") => a.split\-``

x.indexOf(y)=>0 => x.includes(y)

Using string templates with functions
When you have a function with one string as the arguments. You can omit the () if you don't have any expressions:
join`` // Works
join`foobar` // Works
join`${5}` // Doesn't work

Be warned, this actually passes an array. fun`string`  is the same as fun(["string"]), not fun("string"). This is fine for functions that cast to string, like alert, but for others this could cause issues. For more information see the MDN article

Quick reference thing: fun`foo${1}bar${2}baz is equivalent to calling fun(["foo","bar","baz"],1,2)

Array Comprehensions (Firefox 30-57)
Note: array comprehensions were never standardized, and were made obsolete with Firefox 58. Use at your own peril.

Originally, the ECMAScript 7 spec contained a bunch of new array-based features. Though most of these didn't make it into the finalized version, Firefox support(ed) possibly the biggest of these features: fancy new syntax that can replace .filter and .map with for(a of b) syntax. Here's an example:
b.filter(a=>/\s/.test(a)).map(a=>a.length)
[for(a of b)if(/\s/.test(a))a.length]

As you can see, the two lines are not all that different, other than the second not containing the bulky keywords and arrow functions. But this only accounts for the order.filter().map(); what happens if you have .map().filter() instead? It really depends on the situation:
b.map(a=>a[0]).filter(a=>a<'['&&a>'@')
[for(a of b)if(a<'['&&a>'@')a[0]]

b.map(a=>c.indexOf(a)).filter(a=>a>-1)
[for(a of b)if((d=c.indexOf(a))>-1)d]

b.map(a=>a.toString(2)).filter(a=>/01/.test(a))
[for(a of b)if(/01/.test(c=a.toString(2)))c]

Or what if you want either .map or .filter? Well, it usually turns out less OK:
b.map(a=>a.toString(2))
[for(a of b)a.toString(2)]

b.filter(a=>a%3&&a%5)
[for(a of b)if(a%3&&a%5)a]

So my advice is to use array comprehensions wherever you would usually use .map and .filter, but not just one or the other.
String Comprehensions
A nice thing about ES7 comprehensions is that, unlike array-specific functions such as .map and .filter, they can be used on any iterable object, not just arrays. This is especially useful when dealing with strings. For example, if you want to run each character c in a string through c.charCodeAt():
x=>[...x].map(c=>c.charCodeAt())
x=>[for(c of x)c.charCodeAt()]

That's two bytes saved on a fairly small scale. And what if you want to filter certain characters in a string? For example, this one keeps only capital letters:
x=>[...x].filter(c=>c<'['&&c>'@')
x=>[for(c of x)if(c<'['&&c>'@')c]

Hmm, that's not any shorter. But if we combine the two:
x=>[...x].filter(c=>c<'['&&c>'@').map(c=>c.charCodeAt())
x=>[for(c of x)if(c<'['&&c>'@')c.charCodeAt()]

Wow, a whole 10 bytes saved!
Another advantage of string comprehensions is that hardcoded strings save an extra byte, since you can omit the space after of:
x=>[...'[](){}<>'].map(c=>x.split(c).length-1)
x=>[for(c of'[](){}<>')x.split(c).length-1]

x=>[...'[](){}<>'].filter(c=>x.split(c).length>3)
x=>[for(c of'[](){}<>')if(x.split(c).length>3)c]

Indexing
Array comprehensions make it a little harder to get the current index in the string/array, but it can be done:
a.map((x,i)=>x+i).filter ((x,i)=>~i%2)
[for(x of(i=0,a))if(++i%2)x+i-1]

The main thing to be careful of is to make sure the index gets incremented every time, not just when a condition is met.
Generator comprehensions
Generator comprehensions have basically the same syntax as array comprehensions; just replace the brackets with parentheses:
x=>(for(c of x)if(c<'['&&c>'@')c.charCodeAt())

This creates a generator which functions in much the same way as an array, but that's a story for another answer.
Summary
Basically, although comprehensions are usually shorter than .map().filter(), it all comes down to the specifics of the situation. It's best to try it both ways and see which works out better.
P.S. Feel free to suggest another comprehension-related tip or a way to improve this answer!

Here's a trick for ranges that'll save a couple more characters: (x,y)=>[...Array(y-x)].map(a=>x++)

You can cut off another 11 bytes to make a range from 0 to x: x=>[...Array(x).keys()]

Last one for the comprehension there: n=>[for(x of Array(n).keys())if(/1/.test(x))x] (saves 7 bytes)

@Mwr247 Actually, I can see now that ranges are usually not as short with comprehensions as with other nice ES6 features. I'll add in a section on strings instead, and let you handle ranges.

It is worth noting that Array Comprehensions have been deprecated and removed from all recent versions of javascript. See the MDN docs on the subject.

@KeeferRourke Thanks, added a note to the top of the answer.

Function expressions in ES6 use the arrow notation, and it helps a lot saving bytes if compared with the ES5 version:
f=function(x,y){return x+y}
f=(x,y)=>x+y

If your function only has one parameter, you can omit the parentheses to save two bytes:
f=x=>x+1

If your function has no parameters at all, declare it as if it had one to save one byte:
f=()=>"something"
f=x=>"something"

Beware: Arrow functions are not exactly the same as function () {}. The rules for this are different (and better IMO). See docs

But when you are golf-ing, you generally don't care about this etc.

Generally not, but it is a caveat, one that you may never know when it comes up. It's also more common for lambdas to not need a function-local this binding in production.

Also, if you want to take all of your arguments, you can use the "rest" argument feature, e.g., f=(...x)=>x  would have that f(1,2,3) => [1,2,3].

Here's a tip specific to this site: if you're answering with a function that takes the form (x,y)=>... you can save a byte with currying by replacing it with x=>y=>...

Using eval for arrow functions with multiple statements and a return
One of the more ridiculous tricks I've stumbled across...
Imagine a simple arrow function that needs multiple statements and a return.
a=>{for(o="",i=0;i<a;i++)o+=i;return o}

A simple function accepting a single parameter a, which iterates over all integers in [0, a), and tacks them onto the end of the output string o, which is returned. For example, calling this with 4 as the parameter would yield 0123.
Note that this arrow function had to be wrapped in braces {}, and have a return o at the end.
This first attempt weighs in at 39 bytes.
Not bad, but by using eval, we can improve this.
a=>eval('for(o="",i=0;i<a;i++)o+=i;o')

This function removed the braces and the return statement by wrapping the code in an eval and simply making the last statement in the eval evaluate to o. This causes the eval to return o, which in turn causes the function to return o, since it is now a single statement.
This improved attempt weighs in at 38 bytes, saving one byte from the original.
But wait, there's more! Eval statements return whatever their last statement evaluated to. In this case, o+=i evaluates to o, so we don't need the ;o! (Thanks, edc65!)
a=>eval('for(o="",i=0;i<a;i++)o+=i')

This final attempt weighs only 36 bytes - a 3 byte savings over the original!

This technique could be extended to any general case where an arrow function needs to return a value and have multiple statements (that couldn't be combined by other means)
b=>{statement1;statement2;return v}

becomes
b=>eval('statement1;statement2;v')

saving a byte.
If statement2 evaluates to v, this can be
b=>eval('statement1;statement2')

saving a total of 3 bytes.

I think, just writing an anonymous function might be even shorter

@vihan yeah, both of these functions could be made anonymous to save 2 bytes each. The one byte savings still stands though.

But even better: eval returns the last expression evalued, so you don't need ;o - try it: a=>eval('for(o="",i=0;i<a;i++)o+=i')

But template strings!

@CᴏɴᴏʀO'Bʀɪᴇɴ Care to explain how template strings would work here using the example function as context?

@WallyWest template strings are great and do all things.

@CᴏɴᴏʀO'Bʀɪᴇɴ Was kinda hoping for an example with code to demonstrate your comment, mate! ;)

@WallyWest my original content was founded in humour, but using template strings looks more ES6-y ;)

You call that golfing? 6 chars shorter: a=>[...Array(a).keys()].join\``

@CamiloMartin You call that golfing? 12 chars shorter: f=a=>a?f(--a)+a:"" (than yours)

Prefer template string new lines over "\n"
This will start to pay off at even a single new line character in your code. One use case might be:
(16 bytes)
array.join("\n")

(15 bytes)
array.join(`
`)

Update: You can even leave away the braces due to tagged template strings (thanks, edc65!):
(13 bytes)
array.join`
`

But even better, you can avoid the parenthesis. Read docs (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings) to see why

Returning Values in Arrow Functions
It's common knowledge that if a single statement follows the arrow function declaration, it returns the result of that statement:
a=>{return a+3}
a=>a+3

-7 bytes
So when possible, combine multiple statements into one. This is most easily done by surrounding the statements with parentheses and separating them with commas:
a=>{r=0;a.map(n=>r+=n);return r}
a=>(r=0,a.map(n=>r+=n),r)

-8 bytes
But if there are only two statements, it is usually possible (and shorter) to combine them with && or ||:
a=>{r=0;a.map(n=>r+=n);return r}

// - Use && because map always returns an array (true)
// - declaration of r moved into unused map argument to make it only 2 statements
a=>a.map(n=>r+=n,r=0)&&r

-9 bytes
Finally if you are using map (or similar) and need to return a number and you can guarantee the map will never return a 1-length array with a number, you can return the number with |:
a=>{a=b=0;a.map(n=>(a+=n,b-=n));return a/b}

// - {} in map ensures it returns an array of undefined, so the | will make the returned
//   array cast from [ undefined, undefined, undefined ] to ",," to NaN to 0 and 0|n = n,
//   if the map returned [ 4 ] it would cast from [ 4 ] to "4" to 4 and make it 4|n
a=>a.map(n=>{a+=n,b-=n},a=b=0)|a/b

In that last example, you also need to be sure that the number will always be an integer.

Writing RegEx literals with eval
The regex constructor can be very bulky due to it's long name. Instead, write a literal with eval and backticks:
eval(`/<${i} [^>]+/g`)

If the variable i is equal to foo, this will generate:
/<foo [^>]+/g

This is equal to:
new RegExp("<"+i+" [^>]+","g")

You can also use String.raw to avoid having to repeatedly escape backslashes \
eval(String.raw`/\(?:\d{4})?\d{3}\d{3}\d{3}\d{3}\d{3}\d{3}\d{4}/g`)

This will output:
/(?:\d{4})?\d{3}\d{3}\d{3}/g

Which is equal to:
RegExp("\\(?:\\d{4})?\\d{3}\\d{3}\\d{3}\\d{3}\\d{3}\\d{3}\\d{4}","g")

Keep in mind!
String.raw takes up a lot of bytes and unless you have at least nine backslashes, String.raw will be longer.

You don't need the new in there, so using the constructor is actually shorter for the second example

Optimizing small constant ranges for map()
Context
Starting with ES6, it has become fairly common to use (and abuse) the map() method instead of a for loop to iterate over a range \$[0..N-1]\$, so that the entire answer can be written in functional style:
for(i = 0; i < 10; i++) {
  do_something_with(i);
}

can be replaced by either:
[...Array(10).keys()].map(i => do_something_with(i))

or more commonly:
[...Array(10)].map((_, i) => do_something_with(i))

However, using Array(N) is rarely optimal when \$N\$ is a small constant.
Optimizations for a range \$[0..N-1]\$, with counter
Below is a summary of shorter alternate methods when the counter \$i\$ is used within the callback:
N           | Method                               | Example                         | Length
------------+--------------------------------------+---------------------------------+-------
N ≤ 6       | use a raw array of integers          | [0,1,2,3].map(i=>F(i))          | 2N+10
N = 7       | use either a raw array of integers   | [0,1,2,3,4,5,6].map(i=>F(i))    | 24
            | or a string if your code can operate | [...'0123456'].map(i=>F(i))     | 23
            | with characters rather than integers |                                 |
8 ≤ N ≤ 9   | use scientific notation 1e[N-1]      | [...1e7+''].map((_,i)=>F(i))    | 24
N = 10      | use scientific notation 1e9          | [...1e9+''].map((_,i)=>F(i))    | 24
            | or the ES7 expression 2**29+'4' if   | [...2**29+'4'].map(i=>F(i))     | 23
            | the order doesn't matter and your    |                                 |
            | code can operate with characters     |  (order: 5,3,6,8,7,0,9,1,2,4)   |
            | rather than integers                 |                                 |
11 ≤ N ≤ 17 | use scientific notation 1e[N-1]      | [...1e12+''].map((_,i)=>F(i))   | 25
N = 18      | use the fraction 1/3                 | [...1/3+''].map((_,i)=>F(i))    | 24
N = 19      | use the fraction 1/6                 | [...1/6+''].map((_,i)=>F(i))    | 24
20 ≤ N ≤ 21 | use scientific notation 1e[N-1]      | [...1e20+''].map((_,i)=>F(i))   | 25
N = 22      | use scientific notation -1e20        | [...-1e20+''].map((_,i)=>F(i))  | 26
23 ≤ N ≤ 99 | use Array(N)                         | [...Array(23)].map((_,i)=>F(i)) | 27

NB: The length of the callback code F(i) is not counted.
Optimization for the range \$[1..9]\$, with counter
If you'd like to iterate over the range \$[1..9]\$ and the order doesn't matter, you can use the following ES7 expression (provided that your code can operate with characters rather than integers):
[...17**6+'8'].map(i=>F(i))  // order: 2,4,1,3,7,5,6,9,8; length: 23

Optimizations without counter
The following methods can be used if you just need to iterate \$N\$ times, without using a counter:
N           | Method                               | Example                         | Length
------------+--------------------------------------+---------------------------------+-------
N ≤ 5       | use a raw array of integers          | [0,0,0,0].map(_=>F())           | 2N+10
6 ≤ N ≤ 10  | use scientific notation 1e[N-1]      | [...1e7+''].map(_=>F())         | 20
11 ≤ N ≤ 17 | use scientific notation 1e[N-1]      | [...1e12+''].map(_=>F())        | 21
N = 18      | use the fraction 1/3                 | [...1/3+''].map(_=>F())         | 20
N = 19      | use the fraction 1/6                 | [...1/6+''].map(_=>F())         | 20
20 ≤ N ≤ 21 | use scientific notation 1e[N-1]      | [...1e20+''].map(_=>F())        | 21
N = 22      | use scientific notation -1e20        | [...-1e20+''].map(_=>F())       | 22
23 ≤ N ≤ 99 | use Array(N)                         | [...Array(23)].map(_=>F())      | 23

NB: The length of the callback code F() is not counted.

Shouldn't 2**26 be 2**29?

@Shaggy Heck. Good catch!

Didn't want to edit in myself 'cause I've got code-blindness! :D

Using .keys(), you don't need a lambda :
[...Array(10).keys()].map(do_something_with)

@long-lazuli If you don't need a lambda and just want a range, then you probably don't need map either...

38(FF)/34(V8): [...isNaN+'']

and one of your function if it's length fit

Using .padEnd() instead of .repeat() (ES8)
Under certain circumstances, using .padEnd() instead of .repeat() saves bytes.
We can take advantage of the following properties:

the default padding string is a single space
when provided, the second parameter is implicitly coerced to a string

Repeating spaces
With .repeat():
' '.repeat(10)

Using .padEnd() saves 1 byte:
''.padEnd(10)

Try it online!
Repeating a dynamic value that needs to be coerced to a string
With .repeat():
x=1;
(x+'').repeat(10)

Using .padEnd() saves 2 bytes:
x=1;
''.padEnd(10,x)

Try it online!

Filling Arrays - Static Values & Dynamic Ranges
I originally left these as comments under comprehensions, but since that post was primarily focused on comprehensions, I figured that it would be good to give this it's own place.
ES6 gave us the ability to fill arrays with static values without the use of loops:
// ES5
function(x){for(i=0,a=[];i<x;i++)a[i]=0;return a}

// ES6
x=>Array(x).fill(0)

Both return an array of length x, filled with the value 0.
If you want to fill arrays with dynamic values (such as a range from 0...x) however, the result is a little longer (although still shorter than the old way):
// ES5
function(x){for(i=0,a=[];i<x;i++)a[i]=i;return a}

// ES6
x=>Array(x).fill().map((a,i)=>i)

Both return an array of length x, starting with the value 0 and ending in x-1.
The reason you need the .fill() in there is because simply initializing an array won't let you map it. That is to say, doing x=>Array(x).map((a,i)=>i) will return an empty array. You can also get around the need for fill (and thus make it even shorter) by using the spread operator like so:
x=>[...Array(x)]

Using the spread operator and .keys() function, you can now make a short 0...x range:
x=>[...Array(x).keys()]

If you want a custom range from x...y, or a specialized range altogether (such as even numbers), you can get rid of .keys() and just use .map(), or use .filter(), with the spread operator:
// Custom range from x...y
(x,y)=>[...Array(y-x)].map(a=>x++)

// Even numbers (using map)
x=>[...Array(x/2)].map((a,i)=>i*2)

// Even numbers (using filter)
x=>[...Array(x).keys()].filter(a=>~a%2)

Here's a suggestion for the second example: x=>Array(x).fill(i=0).map(a=>i++) Also, I'm not sure that the 0 in .fill(0) is necessary. Have you tried it without?

@ETHproductions You're right, I forgot the 0 isn't needed in the fill before map. This makes it 1 character shorter than your suggested one though, so I'll keep it like that. Thanks!

Also, for the last example, a=>a%2-1 works fine, as does a=>a%2<1.

A new trick I've learned: [...Array(x)] works just as well as Array(x).fill(), and is 2 bytes shorter. x=>[...Array(x)].map((a,i)=>i)

Weird that I forgot to mention that one (since it was really the whole point of this answer)... I was focusing on what you could do with it (like with keys), rather than it's simplest form. I'll edit that in, thanks =)

This deserves more upvotes! It's very useful in many scenarios.

You can also use generators: x=>[...function*(n){for(;n--;)yield n}(x)] generates [x-1,...,0]. Of course, x=>[...Array(x)].map(_=>--x) and x=>[for(i of Array(x))--x] are still a good bit shorter. (Maybe you could add a section about using array comprehensions?)

got 1 byte shorter!
[...9**x+'']
works up to 22; for array of 8 you can use [...1/0+'']

also 4: [...1/4+'']; 18: [...1/3+'']; 19: [...1/7+'']; 32:[...Map+'']; etc..;

@yonatanmn Very nice! Only comments would be 1) the 1/4 example would be shorter written out [0,0,0,0], and 2) stringified functions are implementation specific, so won't return a reliable length (Map is 32 bytes in Chrome, but 36 bytes in Firefox).

If you need to map over a 0...n range, you can usually save a byte using Array.from (ex: [...Array(N).keys()].map(i=>i*2) vs Array.from(Array(N),(_,i)=>i*2))

How to golf with recursion
Recursion, though not the fastest option, is very often the shortest. Generally, recursion is shortest if the solution can simplified to the solution to a smaller part of the challenge, especially if the input is a number or a string. For instance, if f("abcd") can be calculated from "a" and f("bcd"), it's usually best to use recursion.
Take, for instance, factorial:
n=>[...Array(n).keys()].reduce((x,y)=>x*++y,1)
n=>[...Array(n)].reduce((x,_,i)=>x*++i,1)
n=>[...Array(n)].reduce(x=>x*n--,1)
n=>{for(t=1;n;)t*=n--;return t}
n=>eval("for(t=1;n;)t*=n--")
f=n=>n?n*f(n-1):1

In this example, recursion is obviously way shorter than any other option.
How about sum of charcodes:
s=>[...s].map(x=>t+=x.charCodeAt(),t=0)|t
s=>[...s].reduce((t,x)=>t+x.charCodeAt())
s=>[for(x of(t=0,s))t+=x.charCodeAt()]|t  // Firefox 30+ only
f=s=>s?s.charCodeAt()+f(s.slice(1)):0

This one is trickier, but we can see that when implemented correctly, recursion saves 4 bytes over .map.
Now let's look at the different types of recursion:
Pre-recursion
This is usually the shortest type of recursion. The input is split into two parts a and b, and the function calculates something with a and f(b). Going back to our factorial example:
f=n=>n?n*f(n-1):1

In this case, a is n, b is n-1, and the value returned is a*f(b).
Important note: All recursive functions must have a way to stop recursing when the input is small enough. In the factorial function, this is controlled with the n? :1, i.e. if the input is 0, return 1 without calling f again.
Post-recursion
Post-recursion is similar to pre-recursion, but slightly different. The input is split into two parts a and b, and the function calculates something with a, then calls f(b,a). The second argument usually has a default value (i.e. f(a,b=1)).
Pre-recursion is good when you need to do something special with the final result. For example, if you want the factorial of a number plus 1:
f=(n,p=1)=>n?f(n-1,n*p):p+1

Even then, however, post- is not always shorter than using pre-recursion within another function:
n=>(f=n=>n?n*f(n-1):1)(n)+1

So when is it shorter? You may notice that post-recursion in this example requires parentheses around the function arguments, while pre-recursion did not. Generally, if both solutions need parentheses around the arguments, post-recursion is around 2 bytes shorter:
n=>!(g=([x,...a])=>a[0]?x-a.pop()+g(a):0)(n)
f=([x,...a],n=0)=>a[0]?f(a,x-a.pop()+n):!n

(programs here taken from this answer)
How to find the shortest solution
Usually the only way to find the shortest method is to try all of them. This includes:

Loops
.map (for strings, either [...s].map or s.replace; for numbers, you can create a range)
Array comprehensions
Pre-recursion (sometimes within another of these options)
Post-recursion

And these are just the most common solutions; the best solution might be a combination of these, or even something entirely different. The best way to find the shortest solution is to try everything.

+1 for its value, and i'd like to add another +1 for zootopia

Random template-string hacks
This function riffles two strings (i.e. turns "abc","de" into "adbec"):
f=(x,y)=>String.raw({raw:x},...y)

Note that this only works when x is longer than y. How does it work, you ask? String.raw is designed to be a template tag, like so:
String.raw`x: ${x}\ny: ${y}\nx + y: ${x + y}`

This basically calls String.raw(["x: ", "\ny: ", "\nx + y: ", ""], x, y, x + y), though it's not that simple. The template array also has a special raw property, which is basically a copy of the array, but with the raw strings. String.raw(x, ...args) basically returns x.raw[0] + args[0] + x.raw[1] + args[1] + x.raw[2] + ... and so on until x runs out of items.
So now that we know how String.raw works, we can use it to our advantage:
f=(x,y)=>String.raw({raw:x},...y)                   // f("abc", "de") => "adbec"
f=x=>String.raw({raw:x},...[...x].keys())           // f("abc") => "a0b1c"
f=(x,y)=>String.raw({raw:x},...[...x].fill(y))      // f("abc", " ") => "a b c"

Of course, for that last one, f=(x,y)=>x.split``.join(y) is way shorter, but you get the idea.
Here are a couple of riffling functions that also work if x and y are of equal length:
f=(x,y)=>String.raw({raw:x.match(/.?/g)},...y)
f=(x,y)=>String.raw({raw:x},...y)+y.slice(-1)  // Only works if x.length == y.length

You can learn more about String.raw on MDN.

Shorter ways to do .replace

If you want to replace all instances of one exact substring with another in a string, the obvious way would be:
f=s=>s.replace(/l/g,"y") // 24 bytes
f("Hello, World!")       // -> "Heyyo, Woryd!"

However, you can do 1 byte shorter:
f=s=>s.split`l`.join`y`  // 23 bytes
f("Hello, World!")       // -> "Heyyo, Woryd!"

Note that this is no longer shorter if you want to use any regex features besides the g flag. However, if you're replacing all instances of a variable, it's usually far shorter:
f=(s,c)=>s.replace(RegExp(c,"g"),"") // 36 bytes
f=(s,c)=>s.split(c).join``           // 26 bytes
f("Hello, World!","l") // -> "Heo, Word!"

Sometimes you'll want to map over each char in a string, replacing each one with something else. I often find myself doing this:
f=s=>s.split``.map(x=>x+x).join`` // 33 bytes
f=s=>[...s].map(x=>x+x).join``    // 30 bytes
f("abc") // -> "aabbcc"

However, .replace is almost always shorter:
f=s=>s.replace(/./g,x=>x+x)  // 27 bytes
f=s=>s.replace(/./g,"$&$&")  // Also works in this particular case

Now, if you want to map over each char in a string but don't care about the resulting string, .map is usually better because you can get rid of .join``:
f=s=>s.replace(/./g,x=>t+=+x,t=0)&&t // 36 bytes
f=s=>[...s].map(x=>t+=+x,t=0)&&t     // 32 bytes
f("12345")  // -> 15

For the last case, if only certain characters matching a regex (like /\w/g) are interested, then using replace will be much better as in this demo.

.forEach vs for loops
Always prefer .map to any for loop. Easy, instant savings.

a.map(f)
for(x of a)f(x);
for(i=0;i<a.length;)f(a[i++]);

8 bytes total for original
8 bytes saved vs for-of (50% reduction)
22 bytes saved vs C-style for loop (73% reduction)

a.map(x=>f(x,0))
for(x of a)f(x,0);
for(i=0;i<a.length;)f(a[i++],0);

16 bytes total for original
2 bytes saved vs for-of (11% reduction)
16 bytes saved vs C-style for loop (50% reduction)

a.map((x,i)=>f(x,i,0))
for(i in a)f(a[i],i,0);
for(i=0;i<a.length;)f(a[i],i++,0);

22 bytes total for original
1 byte saved vs for-in (4% reduction)
11 bytes saved vs C-style for loop (33% reduction)

a.map(x=>f(x)&g(x))
for(x of a)f(x),g(x);
for(i=0;i<a.length;)f(x=a[i++]),g(x);

19 bytes total for original
2 bytes saved vs for-of (10% reduction)
18 bytes saved vs C-style for loop (49% reduction)

"Always prefer .map to any for loop." is overstating it a bit. If the item in question isn't an Array, e.g. you want to iterate over characters in a string, the conversion to an Array ([...s]) usually eats the savings from map; for(c of s)f(c) is longer than the unusual case of [...s].map(f), but if you'd need a closure only for the map, for(c of s)expr_with_c is meaningfully shorter than [...s].map(c=>expr_with_c).

ES6 functions
Math
Math.cbrt(x) saves characters than Math.pow(x,1/3), however this is obsolete when using x**1/3.
Math.cbrt(x)
Math.pow(x,1/3)

3 chars saved
Math.hypot(...args) is useful when you need the square root of the sum of the squares of the args. Making ES6 code to do that is generally much longer than using a built-in, although it can differ depending on your output format.
The function Math.trunc(x) wouldn't be helpful, as x|0 is shorter. (Thanks Mwr247!)
There are many properties that take lots of code to do in ES5, but easier in ES6:

Math.acosh, asinh, atanh, cosh, sinh, tanh. Calculates the hyperbolic equivalent of trigonometric functions, but are almost never used, except very occasionally.
Math.clz32. Might be possible to do in ES5, but is easier now. Counts leading zeros in the 32-bit representation of a number.

There are a lot more, so I'm just going to list some:
Math.sign (occasionally useful), Math.fround (useless), Math.imul (useless), Math.log10 (sometimes shorter than length), Math.log2 (very useful), Math.log1p (almost completely useless).

Math.trunc(x) is four times longer than x|0.

@mwr247: Ok, will update.

Here's the shortest ES5 equivalents I know of for a couple of these functions: Math.hypot(a,b) => Math.sqrt(a*a+b*b) (3 bytes longer; gets even longer with more arguments), Math.sign(a) => (a>0)-(a<0) (1 byte shorter, but needs surrounding parentheses in some cases; may not work with NaN)

@ETHproductions You need the arguments array for (the es5 workaround of) hypot. And are you sure that the workaround for Math.sign works for -0? (It should return -0)

@ev3commander These are just meant as in-line replacements for their respective ES6 equivalents, so they are scaled down for 99% of uses. Truly recreating these functions would require a lot more code. Also, I see no reason for needing to have a special case for -0, since (AFAIK) there's no way to obtain -0 except by manually specifying it, and practically no use for it within code-golf. But thanks for pointing those things out.

Man, don't use <br>s when you have Markdown. <br> = two spaces at the end of line, <p> = just separate the text with a blank line. Also use 4 spaces or backticks instead of <pre>. Fixed it in case you want to check.

Technically x**(1/3) is 4 characters shorter than Math.cbrt(x) and (a*a+b*b)**.5 is two characters shorter than Math.hypot(a,b)

Using uninitialized counters in recursion
Note: Strictly speaking, this is not specific to ES6. It makes more sense to use and abuse recursion in ES6, however, because of the concise nature of arrow functions.

It is rather common to come across a recursive function that's using a counter k initially set to zero and incremented at each iteration:
f = (…, k=0) => [do a recursive call with f(…, k+1)]

Under certain circumstances, it's possible to omit the initialization
of such a counter and replace k+1 with -~k:
f = (…, k) => [do a recursive call with f(…, -~k)]

This trick typically saves 2 bytes.
Why and when does it work?
The formula that makes it possible is ~undefined === -1. So, on the first iteration, -~k will be evaluated to 1. On the next iterations, -~k is essentially equivalent to -(-k-1) which equals k+1, at least for integers in the range [0 … 231-1].
You must however make sure that having k = undefined on the first iteration will not disrupt the behavior of the function. You should especially keep in mind that most arithmetic operations involving undefined will result in NaN.
Example #1
Given a positive integer n, this function looks for the smallest integer k that doesn't divide n:
f=(n,k=0)=>n%k?k:f(n,k+1)   // 25 bytes

It can be shortened to:
f=(n,k)=>n%k?k:f(n,-~k)     // 23 bytes

This works because n % undefined is NaN, which is falsy. That's the expected result on the first iteration.
[Link to original answer]
Example #2
Given a positive integer n, this function looks for an integer p such that (3**p) - 1 == n:
f=(n,p=0,k=1)=>n<k?n>k-2&&p:f(n,p+1,k*3)  // 40 bytes

It can be shortened to:
f=(n,p,k=1)=>n<k?n>k-2&&p:f(n,-~p,k*3)    // 38 bytes

This works because p is not used at all on the first iteration (n<k being false).
[Link to original answer]

Using flat() when building an array recursively (ES10)
When elements are appended conditionally to an array with recursive calls, a typical construction is:
f=k=>k?[...k%3?[k]:[],...f(k-1)]:[] // 35 bytes

Try it online!
(this example code filters out values that are multiple of 3)
Notice that the spread operators is used twice (costing 6 bytes) and the payload value k has to be put within a singleton array (costing 2 more bytes).
An alternate approach is to apply .flat() immediately after each iteration, saving a byte:
f=k=>k?[k%3?k:[],f(k-1)].flat():[]  // 34 bytes

Try it online!

Return intermediate result
You know that using the comma operator you can execute a sequence of expressions returning the last value. But abusing the literal array syntax, you can return any intermediate value. It's useful in .map() for instance.
// capitalize words
// f is a flag indicating if prev char is space
[...x].map(c=>(f?c=c.toUpperCase():0,f=c<'!',c),f=1).join('')

// shortened to ...
[...x].map(c=>[f?c.toUpperCase():c,f=c<'!'][0],f=1).join('')

Remember, of course, that .join('') can be .join\``

x.replace(/ +./g,c=>c.toUpperCase())

@l4m2 this capitalize all characters, not the first letter of each word

it capitalize letter followed by +, so it's wrong; but fixing it is still cheaper

Primality-testing function
The following 28-byte function returns true for prime numbers and false for non-primes:
f=(n,x=n)=>n%--x?f(n,x):x==1

This can easily be modified to calculate other things. For example, this 39-byte function counts the number of primes less than or equal to a number:
f=(n,x=n)=>n?n%--x?f(n,x):!--x+f(n-1):0

If you already have a variable n that you want to check for primality, the primality function can be simplified quite a bit:
(f=x=>n%--x?f(x):x==1)(n)

How it works
f = (         // Define a function f with these arguments:
  n,          //   n, the number to test;
  x = n       //   x, with a default value of n, the number to check for divisibility by.
) =>
  n % --x ?   //   If n is not divisible by x - 1,
  f(n, x)     //     return the result of f(n, x - 1).
              //   This loops down through all numbers between n and 0,
              //     stopping when it finds a number that divides n.
  : x == 1    //   Return x == 1; for primes only, 1 is the smallest number
              //     less than n that divides n.
              //   For 1, x == 0; for 0, x == -1.

Note: This will fail with a "too much recursion" error when called with a sufficiently large input, such as 12345. You can get around this with a loop:
f=n=>eval('for(x=n;n%--x;);x==1')

But fail with too much recursion for an input as little as 12345

x==1 can probably be x<2 for savings.

@CalculatorFeline Thanks, but then it fails for 1 or 0 (because x would be 0 or -1, respectively)

Could be useful in certain cases.  Also, !~-x for -0 bytes.

Golfing Logical Operations in ES6
"GLOE (S6)"
General Logic
Say you have constructed statements s and t. See if you can use any of the following replacements:
Traditional conjuction: s&&t
Equivalent conjuction: s*t OR s&t

Traditional disjunction: s||t
Equivalent disjunction: s+t OR s|t

(These may not work if the order is wrong; i.e. + and * have a lower order precedence than || and && do.)
Also, here are some handy logical expressions:

Either s or t is true/XOR: s^t
s and t are the same truth value: !s^t or s==t

Array logic
All members of a satisfy condition p:
a.every(p)                             // 10 bytes (11 bytes saved)
a.map(x=>c&=p(x),c=1)                  // 21 bytes (16 bytes saved)
for(i=0,c=1;i<a.length;c&=p(a[i++]));  // 37 bytes (hideously long)

At least one member of a satisfies condition p:
a.some(p)                            // 9  bytes (13 bytes saved)
a.map(x=>c|=p(x),c=0)                // 21 bytes (14 bytes saved)
for(i=c=0;i<a.length;c|=p(a[i++]));  // 35 bytes (just please no)

No members of a satisfy condition p: !a.some(p).
Element e exists in array a:
a.includes(e)                        // 13 bytes, standard built-in
~a.indexOf(e)                        // 13 bytes, "traditional" method
a.find(x=>e==x)                      // 15 bytes, find (ES6)
a.some(x=>x==e)                      // 15 bytes, some (ES5)
(a+"").search(e)                     // 16 bytes, buggy
a.filter(t=>t==e).length             // 24 bytes, no reason to use this
for(i=c=0;i<a.length;c+=e==a[i++]);  // 35 bytes, super-traditional

Element e does not exist in array a:
!a.includes(e)
!~a.indexOf(e)
a.every(t=>t!=e)
!a.filter(t=>t==e).length
for(i=0,c=1;i<a.length;c*=e!=a[i++]);

I generally use && and || as x?y:x and x?x:y, respectively. But I can see how this would be useful in more logic-based programs. The one problem with + would be that e.g. 3 and -3 are both truthy, but 3+-3 is not.

@ETHproductions Ah, you are right; that is an edge case. - could also work, if s != t.

a.filter(t=>t==e).length==a.length is incorrect. It should be !a.filter(t=>t==e).length

@ETHproductions right you are!

Yet another way to avoid return
You know you should use eval for arrow functions with multiple statements and a return. In some unusual case you can save more using an inner subfunction.
I say unusual because

The result returned must not be the last expression evalued in the loop

There must be (at least) 2 different initializations before the loop

In this case you can use an inner subfunction without return, having one of the initial values passed as a parameter.
Example
Find the reciprocal of the sum of exp function for values in a range from a to b.
The long way - 55 bytes
(a,b)=>{for(r=0,i=a;i<=b;i++)r+=Math.exp(i);return 1/r}

With eval - 54 bytes
(a,b)=>eval("for(r=0,i=a;i<=b;i++)r+=Math.exp(i);1/r")

With an inner function - 53 bytes
(a,b)=>(i=>{for(r=0;i<=b;i++)r+=Math.exp(i)})(a)||1/r

Note that without the requirement of a lower range limit a, I can merge the initializations of i and r and the eval version is shorter.

In your sample there's no need to keep a

@l4m2 I can't get your point, help please ...

(i,b)=>{for(r=0;i<=b;i++)r+=Math.exp(i);return 1/r}

@l4m2 uh right,  return a/r would be a better example

eval is still better (a,b)=>1/eval("for(r=0,i=a;i<=b;i++)r+=Math.exp(i)") and in this case (i,b)=>1/eval("for(r=0;i<=b;)r+=Math.exp(i++)")

Using the currying syntax for dyadic and recursive functions
Dyadic functions
Whenever a function takes exactly two arguments with no default values, using the currying syntax saves one byte.
Before
f =
(a,b)=>a+b  // 10 bytes

Called with f(a,b)
After
f =
a=>b=>a+b   // 9 bytes

Called with f(a)(b)
Note: This post in Meta confirms the validity of this syntax.
Recursive functions
Using the currying syntax may also save some bytes when a recursive function takes several arguments but only needs to update some of them between each iteration.
Example
The following function computes the sum of all integers in the range [a,b]:
f=(a,b)=>a>b?0:b+f(a,b-1)   // 25 bytes

Because a remains unchanged during the whole process, we can save 3 bytes by using:
f =                         // no need to include this assignment in the answer anymore
a=>F=b=>a>b?0:b+F(b-1)      // 22 bytes

Note: As noticed by Neil in the comments, the fact that an argument is not explicitly passed to the recursive function does not mean that it should be considered immutable. If needed, we could modify a within the function code with a++, a-- or whatever similar syntax.

The last example can be written as a=>F=b=>a>b?0:a+++F(b), modifying a for each recursive call. This doesn't help in that case but it might save bytes in cases with more arguments.

Heh, I was just thinking about writing a tip for this :-)

Array#concat() and the spread operator
This largely depends on the situation.

Combining multiple arrays.
Prefer the concat function unless cloning.
0 bytes saved
a.concat(b)
[...a,...b]

3 bytes wasted
a.concat(b,c)
[...a,...b,...c]

3 bytes saved
a.concat()
[...a]

6 bytes saved
// Concatenate array of arrays
[].concat.apply([],l)
[].concat(...l)

Prefer using an already existing array to Array#concat().
Easy 4 bytes saved
[].concat(a,b)
a.concat(b)

Avoiding commas when storing lots of data
If you have a lot of data (i. e. indices, characters, …) that you need to store in an array, you might be better off leaving all commas away. This works best if every piece of data has the same string length, 1 obviously being optimal.
43 Bytes (baseline)
a=[[3,7,6,1,8,9,4,5,2],[5,4,3,2,7,6,5,4,3]]

34 Bytes (no commas)
a=[[..."376189452"],[..."543276543"]]

If you're willing to change your array access, you might reduce this even further, storing the same values like so:
27 Bytes (same data, only changes array access)
a=[..."376189452543276543"]

Why is only the last block highlighted?

@CalculatorFeline Thanks, fixed.

Use eval instead of braces for arrow functions
Arrow functions are awesome. They take the form x=>y, where x is an argument and y is the return value. However, if you need to use a control structure, such as while, you would have to put braces, e.g. =>{while(){};return}. However, we can get around this; luckily, the eval function takes a string, evaluates that string as JS code, and returns the last evaluated expression. For example, compare these two:
x=>{while(foo){bar};return baz} // before
x=>eval('while(foo){bar};baz')  // after
//                            ^

We can use an extension of this concept to further shorten our code: in the eyes of eval, control structures also return their last evaluated expression. For example:
x=>{while(foo)bar++;return bar} // before
x=>eval('while(foo)++bar')      // after
//                        ^^^^^

Destructuring assignments
ES6 introduces new syntax for destructuring assignments, i.e. cutting a value into pieces and assigning each piece to a different variable. Here are a few examples:
Strings and arrays
a=s[0];b=s[1];       // 14 bytes
[a,b]=s;             //  8 bytes

a=s[0];s=s.slice(1); // 20 bytes
a=s.shift();         // 12 bytes, only works if s is an array
[a,...s]=s;          // 11 bytes, converts s to an array

Objects
a=o.asdf;b=o.bye;c=o.length; // 28 bytes
{asdf:a,bye:b,length:c}=o;   // 26 bytes

a=o.a;b=o.b;c=o.c; // 18 bytes
{a,b,c}=o;         // 10 bytes

These assignments can also be used in function parameters:
f=a=>a[0]+a[1]+a[2]
f=([a,b,c])=>a+b+c

f=b=>b[1]?b[0]+f(b.slice(1)):b[0]*2
f=b=>b[1]?b.shift()+f(b):b[0]*2
f=([a,...b])=>b[0]?a+f(b):a*2

Use ** (ES7)
** is the new exponentiation operator. Occasionally useful.
Math.pow(2,2) // size: 13, result: 4
2**2          // size:  4, result: 4

This does work for me, tested in Chrome 58 on Linux. Kind of obvious as it's being reported in 2017 and ES6/7 have settled down now, but just to verify.

@Satoshi, when raising a single digit number or a variable with a single character name to the power of 2, it's shorter to just multiply it by itself (e.g., 3*3 or n*n); the exponentiation operator only works out shorter when raising to the power of 3, or higher.

Convert BigInt back to Number (Chrome 67+ / Node.js 10.4+)
!! ALERT : ESNext feature ahead !!
BigInt makes arbitrary-precision integer arithmetic more handy in JS, but there is a caveat - most already existing functions that accepts Number, does not accept BigInt. UPDATE: array indexer DOES support BigInt for some reason.
When we need to convert a BigInt back to Number for some reason, we cannot use +n (this is explicitly forbidden in the specs), but instead we need to use Number(n) -- except we do not really need to do so.
Instead of using Number(n), we realise that we can actually convert the BigInt first into a String and then to a Number using +`${n}` , which saves 2 bytes.
But we can do better: wrap the BigInt with an array then directly cast it using + operator. This gives +[n] which saves 3 more bytes. Most importantly this eliminates the use of Number(n) or even (N=Number)(n) and further N(n)s for multiple uses because +[n] has the same length as N(n).
You can test this out with this example:
s=163n;
console.log(Number(s)) // 9 bytes
console.log(+`${s}`)   // 7 bytes
console.log(+[s])      // 4 bytes

Try it online!

All indexing is done by string value, which is why you can use a BigInt (or anything else with a stringifier).

Default parameters for variable initialization
Suppose you have some long duplicated subexpressions in a lambda:
d.map((x,i)=>[c[i]*c[i+1],c[i]*c[i+1]*x])

Unfortunately, you cannot just do d.map((x,i)=>e=c[i]*c[i+1],[e,e*x]) because apparently e is not available in the scope of the second operand of the comma operator.
But you can "initialize" a variable in a default parameter declaration:
d.map((x,i,_,e=c[i]*c[i+1])=>[e,e*x])

You have to do it at an unused parameter position. Above, the function passed to map only ever gets invoked with three parameters and hence we can exploit the fourth parameter for our purposes.

I did not know about this until I was guided to come here. Have posted this here on the same: https://stackoverflow.com/questions/62780145/alternative-method-for-declaring-local-variables-inside-functions-without-us.

In d.map((x,i)=>e=c[i]*c[i+1],[e,e*x]), it's not a comma operator, it's a parameter separator. Wrapping the expression in ()s would turn it into a comma operator though, for the same length as the parameter version: d.map((x,i)=>(e=c[i]*c[i+1],[e,e*x]))

@Neil and therefore d.map((x,i)=>[e=c[i]*c[i+1],e*x]

Set function parameter defaults
($,a,b,_)=>_!=undefined?'asdf':_ // before
($,a,b,_)=>_!=[]._?'asdf':_ // before, but a bit golfed
($,a,b,_='asdf')=>_ // after

This one's really useful...
However, be sure to understand that something like _=>_||'asdf' is shorter when you're only passing one (useful) argument to the function.

I'd note that using an OR _=>_||'asdf' is usually shorter in most cases

@Downgoat I'd note that that returns "asdf" for an input of "" (empty string).

Note that the default is evaluated whenever the argument would have been undefined, even if you explicitly pass that value. For example, [...Array(n)].map((a,b,c)=>b) always passes undefined for a, and you can therefore provide a default value for it (although not in terms of b).

Bind operator :: (deprecated and unusable in more recent versions of JS)
The bind operator can be used to help shorten bytes over repeated functions:
(x='abc'.search(a))+x.search(b) // Before
(x=::'abc'.search)(a)+x(b)      // 5 bytes saved

Additionally if you want to use the function with a different this e.g.:
s[r='replace'](/a/g,'b')+s[r](/c/g,'d') // Before
(r=s.replace)(/a/g,'b')+s::r(/c/g,'d')  // 1 byte saved

Splitting Strings
Surprised this hasn't been posted already (or maybe I missed it).
If you have an array of 5 or more strings, you can save bytes by instead splitting a string containing all the elements.
["one","two","three","four"]
"one,two,three,four".split`,` // 1 byte longer

["one","two","three","four","five"]
"one,two,three,four,five".split`,` // 1 byte shorter

["one","two","three","four","five","six"]
"one,two,three,four,five,six".split`,` // 3 bytes shorter

For each additional string in your array, you'll save a further 2 bytes with this approach.
If any of your strings contain a comma then change the delimiter to a differet character.

@MettinParzinski: Since when? If the separator is omitted, it's documented to return an length-1 array containing the original string, with no splitting occurring. Tested it locally in Firefox just to be sure, and "one,two,three,four,five,six".split() returned ["one,two,three,four,five,six"].

@ShadowRanger indeed, no idea what I was thinking. Deleted my comment

Shortening Promise Chains with async/await
Taken from my answer here.
Sometimes you can shorten longer promise chains with async/await.  The main benefit is from getting rid of the beginning of the arrow function in each then callback.  .then(x=>x (10) gets replaced with await( (-4), but you first pay with async (+6).  So to make up for the initial overhead of 6 bytes, you'd need at least two then chains to get any benefit.
+-------------+----------------+
| then chains | async overhead |
+-------------+----------------+
| 0           | +6             |
| 1           | +2             |
| 2           | -2             |
| 3           | -4             |
| …           | …              |
+-------------+----------------+

Example 1
x=>x().then(y=>y.foo()).then(z=>z.bar())
async x=>await(await(x()).foo()).bar()

Example 2
u=>fetch(u).then(r=>r.text()).then(t=>/\0/.test(t))
async u=>/\0/.test(await(await fetch(u)).text()))

Shorten repeated function calls
If you have repeated calls to a function with a long-ish name, such as canvas manipulation:
c.lineTo(0,100);c.lineTo(100,100);c.lineTo(100,0);c.lineto(0,0);c.stroke()

The traditional way to shorten it would be to alias the function name:
c[l='lineTo'](0,100);c[l](100,100);c[l](100,0);c[l](0,0);c.stroke()

If you have enough calls, a better way is to create a function that does the job for you:
l=(x,y)=>c.lineTo(x,y);l(0,100);l(100,100);l(100,0);l(0,0);c.stroke()

If most of the function calls are chained, you can make the function return itself, allowing you to cut two bytes off of each successive call:
l=(x,y)=>c.lineTo(x,y)||l;l(0,100)(100,100)(100,0)(0,0);c.stroke()

Example usage: 1, 2

you can shorten with bind operator: (l=::c.lineTo)(0,100)(100,100)(100,0)(0,0);c.stroke()

@Downgoat Thanks, what browsers support that? (Also, from what I've seen that will error on the second call, since c.lineTo does not naturally return itself)

you have to rub it through babel since it's an ES7 feature

Array.prototype.find in array traversing
When traversing an array with Array.prototype.map, all elements are processed. However, when only the first truthy invocation is needed, flags are needed to stop subsequent elements from being processed. When processed with a recursion, more flags may be needed.
However, with Array.prototype.find, flags can be saved. Array.prototype.find receives a function with the same signature as Array.prototype.map does, and returns the first element that the function returns true for that element, or undefined if none returns true.
Consider an example of finding the first non-zero value from a numeric array:
// For-loop
A=>{for(i of A)if(i)return i}
// Array.prototype.map
A=>A.map(x=>i=i||x,i=0)&&i   // -3
// Array.prototype.filter
A=>A.filter(x=>x)[0]         // -9
// Array.prototype.find
A=>A.find(x=>x)              // -14

Real case - determine whether a numeric matrix has all non-zero values connected. The function is written in the way that can be invoked by both map and recursion:
// Uses map: 115 bytes
A=>w=>A.map(x=F=(u,i,a)=>u&&(x||!a)&&[-w,-1,1,w].map(v=>v*v>1|i%w+v>=0&i%w+v<w&&F(A[v+=i],v),x=A[i]=0))&&!+A.join``
// Uses find: 102 bytes
A=>w=>(A.find(F=(u,i)=>u&&[-w,-1,1,w].map(v=>v*v>1|i%w+v>=0&i%w+v<w&&F(A[v+=i],v),A[i]=0)),!+A.join``)

In the case above, we need to only rewrite one region, so we must use flags to avoid further invocation of F by map, but in the meantime we need to also let the recursion run, so another flag is used to indicate whether the invocation is by map or by recursion. With find, both flags are now unnecessary. However, be careful with the return value of the function. In this case, when u is zero then zero is returned, and otherwise an array is returned, which is truthy.

Aliasing using eval and template strings
This one's more effective with longer code containing more repetition:
a.push([0,1,2,3,4,5,6,7,8,9,10].push([0,1,2,3,4,5,6,7,8,9,10].push([0,1,2,3,4,5,6,7,8,9,10]))) // before
a.push([...Array(11).keys()].push([...Array(11).keys()].push([...Array(11).keys()]))) // before - golfed
a.push((f=_=>[...Array(11).keys()])().push(f().push(f()))) // before - golfed more

eval(`a${b=`.push([...Array(11).keys()]`}${b+b})))`) // after

Probably not the best example, but you get the idea.
Although the use case is somewhat limited, it can save quite some bytes, especially because it can get at several char sequences (like [function]([args]) or [...) that would otherwise be unable to be aliased.
Be careful with this, however; very often, using this technique can actually increase, not decrease, your byte count.

It's actually shorter just to do: a=>[...a[b='toLowerCase']()].map(x=>x[b]())[b](). Shouldn't this go under the regular Tips for Golfing in JS?

Perhaps that was a bad example. But the main reason this should go here is because using ${...} is the only way this stays golfy without losing its usefulness.

I'm coming up with a better example.

(strawman) Use do expressions instead of evaling strings
[Babel preset] and [proposal].
Comes with the added bonus of keeping syntax highlighting.  This might be a stretch in some contests, but is nonetheless interesting.  I think if it's supported in Babel, it should qualify as competing.
Consider the following function (37 bytes):
f=n=>{for(o=i=0;i<n;o+=++i);return o}

This might be golfed down with the classic eval trick (34 bytes (thank you everyone)):
f=n=>eval("for(o=i=0;i<n;)o+=++i")

But we can do better with do (30 bytes):
f=n=>do{for(o=i=0;i<n;)o+=++i}

Working example - note that Babel needs let statements in all above functions as well.
Essentially what I'm trying to say is if a solution can be done with eval, you can almost always shave off a few bytes using do.

35 bytes f=n=>eval("for(o=i=0;i<n;)o+=++i")

@Yay295 Incredible!  Updated my post, thank you!

You can golf both of the first two functions down by 5 bytes by replacing f=(n,o=0)=>...i=0; with f=n=>...o=i=0;

@ETHproductions Good point, I should have reflected those changes in the other examples when I updated the third.  Thank you!

Briefly what is Babel?

eval can be golfed even further, to 34 bytes: f=n=>eval("for(o=i=0;i<n;)o+=++i")

@edc65 Implementations of future ES features to make them usable today, in a nutshell

So this is not ES6, maybe ES7 or ESFuture

@edc65 Where's the ES7 thread?

Init with fill in map loop for range
Title may be hard to read.
Instead of
[...Array(n)].map((_,x)=>(y=0,...))

, write
Array(n).fill(0).map((y,x)=>...)

Abuse BigInt comparison
Sometimes, you need to use BigInts to support arbitrary integers. These don't usually combine well with regular numbers, so you sometimes need to use BigInt literals like 5n. But did you know that you can compare BigInts with regular numbers normally?
If you want to know whether a BigInt is e.g. greater than 100, you can use n>100 instead of n>100n, for example.
An example of this is in this golf to this answer where comparison to 63 is used to save a byte.

Shortening getting last element of string/array
Instead of
x[x.length-1] - 13 bytes
(l=x.length)...x[l-1] - (n + 18) bytes

use
x.at(-1) - 8 bytes
x.length...x.at(-1) - (n + 16) bytes

Shortening getting last element of array with mutating
Instead of
x[x.length-1] - 13 bytes
x.at(-1) - 8 bytes

use
x.pop() - 7 bytes

Note that if mutating the array is not an issue then a.pop() is a byte shorter.

@Shaggy Good point! I will add this


text:
False Positives on an Integer Lattice
Leaderboard
 User            Language      Score
 =========================================
 Ell             C++11         293,619,555
 feersum         C++11         100,993,667
 Ell             C++11          78,824,732
 Geobits         Java           27,817,255
 Ell             Python         27,797,402
 Peter Taylor    Java                2,468
 <reference>     Julia                 530

Background
When working on a 2-D grid of integer coordinates, you sometimes want to know whether two vectors (with integer components) have the same magnitude. Of course, in Euclidean geometry the magnitude of a vector (x,y) is given by
√(x² + y²)

So a naive implementation might compute this value for both vectors and compare the results. Not only does that incur an unnecessary square root computation, it also causes trouble with floating point inaccuracies, which might yield false positives: vectors whose magnitudes are different, but where the significant digits in the floating point representation are all identical.
For the purposes of this challenge, we define a false positive as a pair of coordinate pairs (a,b) and (c,d) for which:

Their squared magnitude is different when represented as 64-bit unsigned integers.
Their magnitude is identical when represented as 64-bit binary floating point number and computed via a  64-bit square root (as per IEEE 754).

As an example, using 16-bit representations (instead of 64), the smallest1 pair of vectors which yields a false positive is
(25,20) and (32,0)

Their squared squared magnitudes are 1025 and 1024. Taking the square root yields
32.01562118716424 and 32.0

But in 16-bit floats both of these get truncated to 32.0.
Likewise, the smallest2 pair yielding a false positive for 32-bit representations is
(1659,1220) and (1951,659)

1"Smallest" as measured by their 16-bit floating point magnitude.
2"Smallest" as measured by their 32-bit floating point magnitude.

Lastly, here are a handful of valid 64-bit cases:
 (51594363,51594339) and (54792160,48184783)
 (54356775,54353746) and (54620742,54088476)
 (54197313,46971217) and (51758889,49645356)
 (67102042,  956863) and (67108864,       6) *

* The last case is one of several with the smallest possible magnitude for 64-bit false positives.
The Challenge
In less than 10,000 bytes of code, using a single thread, you're to find as many false positives for 64-bit (binary) floating point numbers  in the coordinate range 0 ≤ y ≤ x (that is, only within the first octant of the Euclidian plane) such that x² + y² ≤ 253 within 10 minutes. If two submissions tie for the same number of pairs, the tie breaker is the actual time taken to find the last of those pairs.
Your program must not use more than 4 GB of memory at any time (for practical reasons).
It must be possible to run your program in two modes: one which outputs every pair as it finds it, and one which only outputs the number of found pairs at the end. The first will be used to verify the validity of your pairs (by looking at some sample of outputs) and the second will be used for actually timing your submission. Note that the printing must be the only difference. In particular, the counting program may not hardcode the number of pairs it could find. It must still perform the same loop that would be used to print all the numbers, and only omit the printing itself!
I will test all submissions on my Windows 8 laptop, so please ask in the comments if you want to use some not-too-common language.
Note that pairs must not be counted twice under switching of the first and second coordinate pair.
Note also that I will run your process via a Ruby controller, which will kill your process if it hasn't finished after 10 minutes. Make sure to output the number of pairs found by then. You can either keep track of time yourself and print the result just before the 10 minutes elapse, or you just output the number of pairs found sporadically, and I will take the last such number as your score.

As a side comment, it's possible to simultaneously determine whether or not an integer is a perfect square and also compute its precise square root efficiently. The following algorithm is 5x faster than hardware square root on my system (comparing 64-bit unsigned integers to 80-bit long double): http://math.stackexchange.com/questions/41337/efficient-way-to-determine-if-a-number-is-perfect-square/878338#878338

C++, 275,000,000+
We'll refer to pairs whose magnitude is accurately representable, such as (x, 0), as honest pairs and to all other pairs as dishonest pairs of magnitude m, where m is the pair's wrongly-reported magnitude.
The first program in the previous post used a set of tightly related couples of honest- and dishonest-pairs:  (x, 0) and (x, 1), respectively, for large enough x.
The second program used the same set of dishonest pairs but extended the set of honest pairs by looking for all honest pairs of integral magnitude.
The program doesn't terminate within ten minutes, but it finds the vast majority of its results very early on, which means that most of the runtime goes to waste.
Instead of keep looking for ever-less-frequent honest pairs, this program uses the spare time to do the next logical thing: extending the set of dishonest pairs.
From the previous post we know that for all large-enough integers r, sqrt(r2 + 1) = r, where sqrt is the floating-point square root function.
Our plan of attack is to find pairs P = (x, y) such that x2 + y2 = r2 + 1 for some large-enough integer r.
That's simple enough to do, but naively looking for individual such pairs is too slow to be interesting.
We want to find these pairs in bulk, just like we did for honest pairs in the previous program.
Let {v, w} be an orthonormal pair of vectors.
For all real scalars r, ||r v + w||2 = r2 + 1.
In ℝ2, this is a direct result of the Pythagorean theorem:

We're looking for vectors v and w such that there exists an integer r for which x and y are also integers.
As a side note, note that the set of dishonest pairs we used in the previous two programs was simply a special case of this, where {v, w} was the standard basis of ℝ2; this time we wish to find a more general solution.
This is where Pythagorean triplets (integers triplets (a, b, c) satisfying a2 + b2 = c2, which we used in the previous program) make their comeback.
Let (a, b, c) be a Pythagorean triplet.
The vectors v = (b/c, a/c) and w = (-a/c, b/c) (and also  w = (a/c, -b/c)) are orthonormal, as is easy to verify.
As it turns out, for any choice of Pythagorean triplet, there exists an integer r such that x and y are integers.
To prove this, and to effectively find r and P, we need a little number/group theory;  I'm going to spare the details.
Either way, suppose we have our integral r, x and y.
We're still short of a few things: we need r to be large enough and we want a fast method to derive many more similar pairs from this one.
Fortunately, there's a simple way to accomplish this.
Note that the projection of P onto v is r v, hence r = P · v = (x, y) · (b/c, a/c) = xb/c + ya/c, all this to say that xb + ya = rc.
As a result, for all integers n, (x + bn)2 + (y + an)2 = (x2 + y2) + 2(xb + ya)n + (a2 + b2)n2 = (r2 + 1) + 2(rc)n + (c2)n2 = (r + cn)2 + 1.
In other words, the squared magnitude of pairs of the form  (x + bn, y + an) is (r + cn)2 + 1, which is exactly the kind of pairs we're looking for!
For large enough n, these are dishonest pairs of magnitude r + cn.
It's always nice to look at a concrete example.
If we take the Pythagorean triplet (3, 4, 5), then at r = 2 we have P = (1, 2) (you can check that (1, 2)  · (4/5, 3/5) = 2 and, clearly, 12 + 22 = 22 + 1.)
Adding 5 to r and (4, 3) to P takes us to r' = 2 + 5 = 7 and P' = (1 + 4, 2 + 3) = (5, 5).
Lo and behold, 52 + 52 = 72 + 1.
The next coordinates are r'' = 12 and P'' = (9, 8), and again, 92 + 82 = 122 + 1, and so on, and so on ...

Once r is large enough, we start getting dishonest pairs with magnitude increments of 5.
That's roughly 27,797,402 / 5 dishonest pairs.
So now we have plenty of integral-magnitude dishonest pairs.
We can easily couple them with the honest pairs of the first program to form false-positives, and with due care we can also use the honest pairs of the second program.
This is basically what this program does.
Like the previous program, it too finds most of its results very early on---it gets to 200,000,000 false positives within a few seconds---and then slows down considerably.
Compile with g++ flspos.cpp -oflspos -std=c++11 -msse2 -mfpmath=sse -O3.
To verify the results, add -DVERIFY (this will be notably slower.)
Run with flspos. Any command-line argument for verbose mode.
#include <cstdio>
#define _USE_MATH_DEFINES
#undef __STRICT_ANSI__
#include <cmath>
#include <cfloat>
#include <vector>
#include <iterator>
#include <algorithm>

using namespace std;

/* Make sure we actually work with 64-bit precision */
#if defined(VERIFY) && FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1
#   error "invalid FLT_EVAL_METHOD (did you forget `-msse2 -mfpmath=sse'?)"
#endif

template <typename T> struct widen;
template <> struct widen<int> { typedef long long type; };

template <typename T>
inline typename widen<T>::type mul(T x, T y) {
    return typename widen<T>::type(x) * typename widen<T>::type(y);
}
template <typename T> inline T div_ceil(T a, T b) { return (a + b - 1) / b; }
template <typename T> inline typename widen<T>::type sq(T x) { return mul(x, x); }
template <typename T>
T gcd(T a, T b) { while (b) { T t = a; a = b; b = t % b; } return a; }
template <typename T>
inline typename widen<T>::type lcm(T a, T b) { return mul(a, b) / gcd(a, b); }
template <typename T>
T div_mod_n(T a, T b, T n) {
    if (b == 0) return a == 0 ? 0 : -1;
    const T n_over_b = n / b, n_mod_b = n % b;
    for (T m = 0; m < n; m += n_over_b + 1) {
        if (a % b == 0) return m + a / b;
        a -= b - n_mod_b;
        if (a < 0) a += n;
    }
    return -1;
}

template <typename T> struct pythagorean_triplet { T a, b, c; };
template <typename T>
struct pythagorean_triplet_generator {
    typedef pythagorean_triplet<T> result_type;
private:
    typedef typename widen<T>::type WT;
    result_type p_triplet;
    WT p_c2b2;
public:
    pythagorean_triplet_generator(const result_type& triplet = {3, 4, 5}) :
        p_triplet(triplet), p_c2b2(sq(triplet.c) - sq(triplet.b))
    {}
    const result_type& operator*() const { return p_triplet; }
    const result_type* operator->() const { return &p_triplet; }
    pythagorean_triplet_generator& operator++() {
        do {
            if (++p_triplet.b == p_triplet.c) {
                ++p_triplet.c;
                p_triplet.b = ceil(p_triplet.c * M_SQRT1_2);
                p_c2b2 = sq(p_triplet.c) - sq(p_triplet.b);
            } else
                p_c2b2 -= 2 * p_triplet.b - 1;
            p_triplet.a = sqrt(p_c2b2);
        } while (sq(p_triplet.a) != p_c2b2 || gcd(p_triplet.b, p_triplet.a) != 1);
        return *this;
    }
    result_type operator()() { result_type t = **this; ++*this; return t; }
};

int main(int argc, const char* argv[]) {
    const bool verbose = argc > 1;

    const int min = 1 << 26;
    const int max = sqrt(1ll << 53);

    const size_t small_triplet_count = 1000;
    vector<pythagorean_triplet<int>> small_triplets;
    small_triplets.reserve(small_triplet_count);
    generate_n(
        back_inserter(small_triplets),
        small_triplet_count,
        pythagorean_triplet_generator<int>()
    );

    int found = 0;
    auto add = [&] (int x1, int y1, int x2, int y2) {
#ifdef VERIFY
        auto n1 = sq(x1) + sq(y1), n2 = sq(x2) + sq(y2);
        if (x1 < y1 || x2 < y2 || x1 > max || x2 > max ||
            n1 == n2 || sqrt(n1) != sqrt(n2)
        ) {
            fprintf(stderr, "Wrong false-positive: (%d, %d) (%d, %d)\n",
                    x1, y1, x2, y2);
            return;
        }
#endif
        if (verbose) printf("(%d, %d) (%d, %d)\n", x1, y1, x2, y2);
        ++found;
    };

    int output_counter = 0;
    for (int x = min; x <= max; ++x) add(x, 0,    x, 1);
    for (pythagorean_triplet_generator<int> i; i->c <= max; ++i) {
        const auto& t1 = *i;

        for (int n = div_ceil(min, t1.c); n <= max / t1.c; ++n)
            add(n * t1.b, n * t1.a,    n * t1.c, 1);

        auto find_false_positives = [&] (int r, int x, int y) {
            {
                int n = div_ceil(min - r, t1.c);
                int min_r = r + n * t1.c;
                int max_n = n + (max - min_r) / t1.c;
                for (; n <= max_n; ++n)
                    add(r + n * t1.c, 0,    x + n * t1.b, y + n * t1.a);
            }
            for (const auto t2 : small_triplets) {
                int m = div_mod_n((t2.c - r % t2.c) % t2.c, t1.c % t2.c, t2.c);
                if (m < 0) continue;
                int sr = r + m * t1.c;
                int c = lcm(t1.c, t2.c);
                int min_n = div_ceil(min - sr, c);
                int min_r = sr + min_n * c;
                if (min_r > max) continue;
                int x1 = x + m * t1.b, y1 = y + m * t1.a;
                int x2 = t2.b * (sr / t2.c), y2 = t2.a * (sr / t2.c);
                int a1 = t1.a * (c / t1.c), b1 = t1.b * (c / t1.c);
                int a2 = t2.a * (c / t2.c), b2 = t2.b * (c / t2.c);
                int max_n = min_n + (max - min_r) / c;
                int max_r = sr + max_n * c;
                for (int n = min_n; n <= max_n; ++n) {
                    add(
                        x2 + n * b2, y2 + n * a2,
                        x1 + n * b1, y1 + n * a1
                    );
                }
            }
        };
        {
            int m = div_mod_n((t1.a - t1.c % t1.a) % t1.a, t1.b % t1.a, t1.a);
            find_false_positives(
                /* r = */ (mul(m, t1.c) + t1.b) / t1.a,
                /* x = */ (mul(m, t1.b) + t1.c) / t1.a,
                /* y = */ m
            );
        } {
            int m = div_mod_n((t1.b - t1.c % t1.b) % t1.b, t1.a, t1.b);
            find_false_positives(
                /* r = */ (mul(m, t1.c) + t1.a) / t1.b,
                /* x = */ m,
                /* y = */ (mul(m, t1.a) + t1.c) / t1.b
            );
        }

        if (output_counter++ % 50 == 0)
            printf("%d\n", found), fflush(stdout);
    }
    printf("%d\n", found);
}

Nice! :) I got 293,619,555 on my machine and updated the leaderboard.

Python, 27,797,402
Just to set the bar a little higher...
from sys import argv
verbose = len(argv) > 1
found = 0
for x in xrange(67108864, 94906266):
    found += 1
    if verbose:
        print "(%d, 0) (%d, 1)" % (x, x)
print found

It's easy to verify that for all 67,108,864 <= x <= 94,906,265 = floor(sqrt(253)) the pairs (x, 0) and (x, 1) are false positives.
Why it works: 67,108,864 = 226. Therfore, all numbers x in the above range are of the form 226 + x' for some 0 <= x' < 226.
For all positive e, (x + e)2 = x2 + 2xe + e2 = x2 + 227e + 2x'e + e2.
If we want to have  (x + e)2 = x2 + 1 we need at least 227e <= 1, that is, e <= 2-27
However, since the mantissa of double-precision floating point numbers is 52-bit wide, the smallest e such that x + e > x is e = 226 - 52 = 2-26.
In other words, the smallest representable number greater than x is x + 2-26 while the result of sqrt(x2 + 1) is at most x + 2-27.
Since the default IEEE-754 rounding mode is round-to-nearest; ties-to-even, it will always round to x and never to x + 2-26 (where the tie-break is really only relevant for x = 67,108,864, if at all. Any larger number will round to x regardless).

C++, 75,000,000+
Recall that 32 + 42 = 52.
What this means is that the point (4, 3) lies on the circle of radius 5 centered around the origin.
Actually, for all integers n, (4n, 3n) lies on such circle of radius 5n.
For large enough n (namely, such that 5n >= 226), we already know a false-positive for all points on this circle: (5n, 1).
Great! That's another 27,797,402 / 5 free false-positive pairs right there!
But why stop here? (3, 4, 5) is not the only such triplet.
This program looks for all positive integer triplets (a, b, c) such that a2 + b2 = c2, and counts false-positives in this fashion.
It gets to 70,000,000 false-positives pretty fast but then slows down considerably as the numbers grow.
Compile with g++ flspos.cpp -oflspos -std=c++11 -msse2 -mfpmath=sse -O3.
To verify the results, add -DVERIFY (this will be notably slower.)
Run with flspos. Any command-line argument for verbose mode.
#include <cstdio>
#include <cmath>
#include <cfloat>

using namespace std;

/* Make sure we actually work with 64-bit precision */
#if defined(VERIFY) && FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1
#   error "invalid FLT_EVAL_METHOD (did you forget `-msse2 -mfpmath=sse'?)"
#endif

template <typename T> inline long long sqr(T x) { return 1ll * x * x; }
template <typename T>
T gcd(T a, T b) { while (b) { T t = a; a = b; b = t % b; } return a; }

int main(int argc, const char* argv[]) {
    const bool verbose = argc > 1;

    const int min = 1 << 26;
    const int max = sqrt(1ll << 53);

    int found = 0;
    auto add = [=, &found] (int x1, int y1, int x2, int y2) {
#ifdef VERIFY
        auto n1 = sqr(x1) + sqr(y1), n2 = sqr(x2) + sqr(y2);
        if (n1 == n2 || sqrt(n1) != sqrt(n2)) {
            fprintf(stderr, "Wrong false-positive: (%d, %d) (%d, %d)\n",
                    x1, y1, x2, y2);
            return;
        }
#endif
        if (verbose) printf("(%d, %d) (%d, %d)\n", x1, x2, y1, y2);
        ++found;
    };

    for (int x = min; x <= max; ++x) add(x, 0,    x, 1);

    for (int a = 1; a < max; ++a) {
        auto a2b2 = sqr(a) + 1;
        for (int b = 1; b <= a; a2b2 += 2 * b + 1, ++b) {
            int c = sqrt(a2b2);
            if (a2b2 == sqr(c) && gcd(a, b) == 1) {
                int max_c = max / c;
                for (int n = (min + c - 1) / c; n <= max_c; ++n)
                    add(n * a, n * b,    n * c, 1);
            }
        }

        if (a % 512 == 0) printf("%d\n", found), fflush(stdout);
    }

    printf("%d\n", found);
}

Yeesh, that's an effective strategy. I had thought that the 2**53 boundary was chosen to rule this out, but I guess not.

Funny how every number in this range works without a single instance of the square roots of x^2 and x^2 + 1 falling on different sides of an integer + 1/2.

@xnor The boundary was chosen in order for the squared magnitude to be exactly representable in 64-bit floats.

Hey, it works, who cares how? ;) Do you mean that the program should count in a dummy loop, or actually verify the results?

@MartinButtner Oh, I see. It looks like the lower bound is that amount divided by the square root of 2. I understand heuristically why such numbers should work, but I'm also curious why every single one works.

I don't think anyone would object if you posted that new submission as an individual answer. I think it would deserve independent upvotes. (Also, I only noticed it because your edit bumped the question, which gave it another upvote. If you posted as an answer, I would have got a notification.)

Also, are you sure the new isn't generating any duplicates?

@MartinBüttner: Yes. Note the test that gcd(a, b) = 1. All the points are on lines of different slopes that intersect at the origin.

@Ell Ah, nifty. Thanks for the clarification!

@MartinBüttner: I have an interesting extension to this that gets to a quarter billion. Is it still worth posting?

@Ell Sure, I'll keep testing submissions and updating the leaderboard (and accepted answer) when they come in.

C++11 - 100,993,667
EDIT: New program.
The old one used too much memory. This one halves the memory usage by using a giant vector array instead of a hash table. Also it removes the random thread cruft.
   /* by feersum  2014/9
   http://codegolf.stackexchange.com/questions/37627/false-positives-on-an-integer-lattice */
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <vector>
using namespace std;
#define ul unsigned long long

#define K const

#define INS(A)   { bool already = false; \
    for(auto e = res[A.p[0][0]].end(), it = res[A.p[0][0]].begin(); it != e; ++it) \
        if(A.p[0][1] == it->y1 && A.p[1][0] == it->x2 && A.p[1][1] == it->y2) { \
            already = true; \
            break; } \
    if(!already) res[A.p[0][0]].push_back( {A.p[0][1], A.p[1][0], A.p[1][1]} ), ++n; }

#define XMAXMIN (1<<26)

struct ints3 {
    int y1, x2, y2;
};

struct pparm {
    int a,b,c,d;
    int E[4];
    pparm(int A,int B,int C, int D):
        E{B*B+D*D,A*B+C*D,A*A+C*C+2*(B+D),A+C}
    {
        a=A;b=B;c=C;d=D;
    }

};

struct ans {
    int p[2][2];

};
ostream&operator<<(ostream&o, ans&a)
{
    o<<'('<<a.p[0][0]<<','<<a.p[0][1]<<"),("<<a.p[1][0]<<','<<a.p[1][1]<<')'<<endl;
    return o;
}

vector<ints3> res[XMAXMIN];

bool print;
int n;

void gen(K pparm&p1, K pparm&p2)
{
#ifdef DBUG
    for(int i=0;i<2;i++){
    K pparm&p=i?p2:p1;
    cout<<' '<<p.a<<' '<<p.b<<' '<<p.c<<' '<<p.d<<' ';}
    cout<<endl;
#endif

    for(ul x = 0; ; ++x) {
        ans a;
        ul s[2];
        for(int i = 0; i < 2; i++) {
            K pparm &p = i?p2:p1;
            int *pt = a.p[i];
            pt[0] = p.b+x*(p.a+x);
            pt[1] = p.d+x*(p.c+x);
            s[i] = (ul)pt[0]*pt[0] + (ul)pt[1]*pt[1];
        }
        if(*s >> 53)
            break;
if(s[1] - s[0] != 1)
exit(4);

        if(sqrt(s[0]) == sqrt(s[1])) {
             for(int i = 0; i < 2; i++)
                if(a.p[i][0] > a.p[i][1])
                    swap(a.p[i][0], a.p[i][1]);
            if(a.p[0][0] > a.p[0][1])
                for(int i = 0; i < 2; i++)
                    swap(a.p[0][i], a.p[1][i]);
            INS(a)
        }
    }
}

int main(int ac, char**av)
{
    for(int i = 1; i < ac; i++) {
        print |= !strcmp(av[1], "-P");
    }

    #define JMAX 43000000
    for(ul j = 0; j < JMAX; j++) {
        pparm p1(-~j,j,~-j,0),p2(j,1,j,j);
        gen(p1,p2);
        if(!print && !(j%1024))
#ifdef DBUG
            cout<<j<<' ',
#endif
            cout<<n<<endl;

    }
    if(print)
        for(vector<ints3>& v: res)
            for(ints3& i: v)
                printf("(%d,%d),(%d,%d)\n", &v - res, i.y1, i.x2, i.y2);

    return 0;
}

Run with a -P argument to print out the points instead of the number thereof.
For me it takes under 2 minutes in the counting mode and about 5 minutes with printing directed to a file (~4 GB), so it did not quite become I/O limited.
My original program was neat, but I dropped most of it since it only could produce on the order of 10^5 results. What it did is to look for parameterizations of the form (x^2+Ax+B, x^2+Cx+D), (x^2+ax+b, x^2+cx+d) such that for any x, (x^2+Ax+B)^2 + (x^2+Cx+D)^2 = (x^2+ax+b)^2 + (x^2+cx+d)^2 + 1. When it found such a set of parameters {a,b,c,d,A,B,C,D} it proceeded to check all of the x values under the maximum. While looking at my debug output from this program, I noticed a certain parameterization of the parameterization of the parameterization that allowed me to produce a lot of numbers easily. I elected not to print out Ell's numbers since I had plenty of my own. Hopefully now someone won't print out both of our sets of numbers and claim to be the winner :)
 /* by feersum  2014/9
   http://codegolf.stackexchange.com/questions/37627/false-positives-on-an-integer-lattice */
    #include <iostream>
    #include <cmath>
    #include <cstdlib>
    #include <cstring>
    #include <functional>
    #include <unordered_set>
    #include <thread>
using namespace std;
#define ul unsigned long long

#define h(S) unordered_##S##set
#define P 2977953206964783763LL
#define K const

#define EQ(T, F)bool operator==(K T&o)K{return!memcmp(F,o.F,sizeof(F));}

struct pparm {
    int a,b,c,d;
    int E[4];
    pparm(int A,int B,int C, int D):
        E{B*B+D*D,A*B+C*D,A*A+C*C+2*(B+D),A+C}
    {
        a=A;b=B;c=C;d=D;
    }
    EQ(pparm,E)
};

struct ans {
    int p[2][2];
    EQ(ans,p)
};
ostream&operator<<(ostream&o, ans&a)
{
    o<<'('<<a.p[0][0]<<','<<a.p[0][1]<<"),("<<a.p[1][0]<<','<<a.p[1][1]<<')'<<endl;
    return o;
}

#define HASH(N,T,F) \
struct N { \
    size_t operator() (K T&p) K { \
        size_t h = 0; \
        for(int i = 4; i--; ) \
            h=h*P+((int*)p.F)[i]; \
        return h; \
    }};

#define INS(r, a) { \
    bool new1 = r.insert(a).second; \
    n += new1; \
    if(print && new1) \
        cout<<a; }

HASH(HA,ans,p)

bool print;
int n;

void gen(h()<ans,HA>&r, K pparm&p1, K pparm&p2)
{
#ifdef DBUG
    for(int i=0;i<2;i++){
    K pparm&p=i?p2:p1;
    cout<<' '<<p.a<<' '<<p.b<<' '<<p.c<<' '<<p.d<<' ';}
    cout<<endl;
#endif

    for(ul x = 0; ; ++x) {
        ans a;
        ul s[2];
        for(int i = 0; i < 2; i++) {
            K pparm &p = i?p2:p1;
            int *pt = a.p[i];
            pt[0] = p.b+x*(p.a+x);
            pt[1] = p.d+x*(p.c+x);
            s[i] = (ul)pt[0]*pt[0] + (ul)pt[1]*pt[1];
        }
        if(*s >> 53)
            break;
if(s[1] - s[0] != 1)
exit(4);

        if(sqrt(s[0]) == sqrt(s[1])) {
             for(int i = 0; i < 2; i++)
                if(a.p[i][0] > a.p[i][1])
                    swap(a.p[i][0], a.p[i][1]);
            INS(r,a)
        }
    }
    //if(!print) cout<<n<<endl;
}

void endit()
{
    this_thread::sleep_for(chrono::seconds(599));
    exit(0);
}

int main(int ac, char**av)
{
    bool kill = false;
    for(int i = 1; i < ac; i++) {
        print |= ac>1 && !stricmp(av[1], "-P");
        kill |= !stricmp(av[i], "-K");
    }

    thread KILLER;
    if(kill)
        KILLER = thread(endit);

    h()<ans, HA> res;
    res.reserve(1<<27);

    #define JMAX 43000000
    for(ul j = 0; j < JMAX; j++) {
        pparm p1(-~j,j,~-j,0),p2(j,1,j,j);
        gen(res,p1,p2);
        if(!print && !(j%1024))
#ifdef DBUG
            cout<<j<<' ',
#endif
            cout<<n<<endl;

    }
    exit(0);
}

I'm getting a bunch of compiler errors: http://pastebin.com/enNcY9fx Any clue what's going on?

@Martin No idea... I copied my post into a file, compiled on a Windows 8 Laptop with identical switches. Works fine for me. What version of gcc do you have?

Btw if they cause errors, you can simply delete all the thread-related bits which are completely unnecessary. They only do something if you use a "-K" option which is not needed.

g++ (GCC) 4.8.1. Okay, I removed the thread bits, but it's still not recognising stricmp for some reason.

Funny, I have the same version. I found someone else reporting the absence of stricmp. They found that instead strcmp worked, which is fine here (case-sensitive rather than insensitive comparison).

Okay, that compiles. But it seems to print only 0s without command-line argument and nothing at all with -P.

Okay, it's the O3 switch that breaks the output.

Your compiler is obviously inhabited by evil spirits, as I tested multiple runs with -O3...:P

Let us continue this discussion in chat.

@MartinBüttner how does this work? When I click on your link I see the preceding discussion but it tells me I am not logged in

I downloaded MinGW-W64 now, and finally got it to run!

Did you remove the printing of the pairs though?

@MartinBüttner whoops, looks like I must have gotten overzealous while deleting stuff. I made an edit restoring the -P functionality.

I've got too many other things going on at the moment, so I'll tell you my idea to improve your approach. With radius-squared near the top end of the range, you can also get collisions between radius-squared which differ by 2.

Java, Bresenham-esque circle scan
Heuristically I expect to get more collisions by starting at the wider end of the annulus. I expected to get some improvement by doing one scan for each collision, recording values for which surplus is between 0 and r2max - r2 inclusive, but in my testing that proved slower than this version. Similarly attempts to use a single int[] buffer rather than lots of creation of two-element arrays and lists. Performance optimisation is a strange beast indeed.
Run with a command-line argument for output of the pairs, and without for simple counts.
import java.util.*;

public class CodeGolf37627 {
    public static void main(String[] args) {
        final int M = 144;
        boolean[] possible = new boolean[M];
        for (int i = 0; i <= M/2; i++) {
            for (int j = 0; j <= M/2; j++) {
                possible[(i*i+j*j)%M] = true;
            }
        }

        long count = 0;
        double sqrt = 0;
        long r2max = 0;
        List<int[]> previousPoints = null;
        for (long r2 = 1L << 53; ; r2--) {
            if (!possible[(int)(r2 % M)]) continue;

            double r = Math.sqrt(r2);
            if (r != sqrt) {
                sqrt = r;
                r2max = r2;
                previousPoints = null;
            }
            else {
                if (previousPoints == null) previousPoints = findLatticePointsBresenham(r2max, (int)r);

                if (previousPoints.size() == 0) {
                    r2max = r2;
                    previousPoints = null;
                }
                else {
                    List<int[]> points = findLatticePointsBresenham(r2, (int)r);
                    for (int[] p1 : points) {
                        for (int[] p2 : previousPoints) {
                            if (args.length > 0) System.out.format("(%d, %d) (%d, %d)\n", p1[0], p1[1], p2[0], p2[1]);
                            count++;
                        }
                    }
                    previousPoints.addAll(points);
                    System.out.println(count);
                }
            }
        }
    }

    // Surprisingly, this seems to be faster than doing one scan for all two or three r2s.
    private static List<int[]> findLatticePointsBresenham(long r2, long r) {
        List<int[]> rv = new ArrayList<int[]>();
        // Require 0 = y = x
        long x = r, y = 0, surplus = r2 - r * r;
        while (y <= x) {
            if (surplus == 0) rv.add(new int[]{(int)x, (int)y});

            // Invariant: surplus = r2 - x*x - y*y >= 0
            y++;
            surplus -= 2*y - 1;
            if (surplus < 0) {
                x--;
                surplus += 2*x + 1;
            }
        }

        return rv;
    }
}

Java - 27,817,255
Most of these are the same as what Ell shows, and the rest are based on (j,0) (k,l). For each j, I walk back some squares and check if the remainder gives a false positive. This takes up basically the entire time with only a 25k (about 0.1%) gain over just (j,0) (j,1), but a gain is a gain.
This will finish in under ten minutes on my machine, but I don't know what you have. Because reasons, if it doesn't finish before the time runs out, it will have a drastically worse score. In that case, you can tweak the divisor on line 8 so that it finishes in time (this simply determines how far back it walks for each j). For some various divisors, scores are:
11    27817255 (best on OPs machine)
10    27818200
8     27820719
7     27822419 (best on my machine)

To turn on output for each match (and, god, it is slow if you do), just uncomment lines 10 and 19.
public class FalsePositive {
    public static void main(String[] args){
        long j = 67108864;
        long start = System.currentTimeMillis();
        long matches=0;
        while(j < 94906265 && System.currentTimeMillis()-start < 599900){
            long jSq = j*j;
            long limit = (long)Math.sqrt(j)/11; // <- tweak to fit inside 10 minutes for best results
            matches++; // count an automatic one for (j,0)(j,1)
            //System.out.println("("+j+",0) ("+j+",1)");
            for(int i=1;i<limit;i++){
                long k = j-i;
                long kSq = k*k;
                long l = (long)Math.sqrt(jSq-kSq);
                long lSq = l*l;
                if(kSq+lSq != jSq){
                    if(Math.sqrt(kSq+lSq)==Math.sqrt(jSq)){
                        matches++;
                        //System.out.println("("+j+",0) ("+k+","+l+")");
                    }
                }
            }
            j++;
        }
        System.out.println("\n"+matches+" Total matches, got to j="+j);
    }
}

For reference, the first 20 outputs it gives (for divisor=7, excluding (j,0)(j,1) types) are:
(67110083,0) (67109538,270462)
(67110675,0) (67109990,303218)
(67111251,0) (67110710,269470)
(67111569,0) (67110668,347756)
(67112019,0) (67111274,316222)
(67112787,0) (67111762,370918)
(67115571,0) (67115518,84346)
(67117699,0) (67117698,11586)
(67117971,0) (67117958,41774)
(67120545,0) (67120040,260368)
(67121043,0) (67120118,352382)
(67122345,0) (67122320,57932)
(67122449,0) (67122444,25908)
(67122633,0) (67122328,202348)
(67122729,0) (67121972,318784)
(67122849,0) (67122568,194224)
(67124195,0) (67123818,224970)
(67125201,0) (67125172,62396)
(67125705,0) (67124632,379540)
(67126195,0) (67125882,204990)

Julia, 530 false positives
Here is a very naive brute force search, which you can view as a reference implementation.
num = 0
for i = 60000000:-1:0
    for j = i:-1:ifloor(0.99*i)
        s = i*i + j*j
        for x = ifloor(sqrt(s/2)):ifloor(sqrt(s))
            min_y = ifloor(sqrt(s - x*x))
            max_y = min_y+1
            for y = min_y:max_y
                r = x*x + y*y
                if r != s && sqrt(r) == sqrt(s)
                    num += 1
                    if num % 10 == 0
                        println("Found $num pairs")
                    end
                    #@printf("(i,j) = (%d,%d); (x,y) = (%d,%d); s = %d, r = %d\n", i,j,x,y,s,r)
                end
            end
        end
    end
end

You can print out the pairs (and their exact squared magnitudes) by uncommenting the @printf line.
Basically this starts the search at x = y = 6e7 for the first coordinate pair and scans down about 1% of the way to the x-axis before decrementing x. Then for each such coordinate pair, it checks the entire arc of the same magnitude (rounding up and down) for a collision.
The code assumes that it's run on a 64-bit system, so that the default integer and floating-point types are 64-bit ones (if not, you can create them with int64() and float64() constructors).
That yields a meagre 530 results.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes