Q:

ES6 Big arrow notation function giving SyntaxError: missing ; before statement

I'm trying my hand on ES6's way to make new functions.
I'm trying to golf a function.
This is what I have so far:
F=>(s){/[^aeiou]{3}|[jqxz]/.test(s)};

BUT this is returning a cryptic error:
SyntaxError: missing ; before statement

If I try without braces:
F=>(s)/[^aeiou]{3}|[jqxz]/.test(s);

I get the folowing error:
SyntaxError: expected expression, got '^'

The regex works fine on it's own.
You can try it yourself.
Can anyone advise me on what I'm doing wrong?

I've tested this on the latest Firefox version (currently, version 35.0.1).
I used it straight into the console: no Firebug on this one!

A:

I think you want
var F = s => /[^aeiou]{3}|[jqxz]/.test(s);

That creates an arrow function which receives an argument s and returns /[^aeiou]{3}|[jqxz]/.test(s).
And that function is assigned to the variable F.

Note that you could also use a not much longer alternative which works in ES5 and should perform better because it won't recreate the regex object at each call.
var F = /(?:)/.test.bind(/[^aeiou]{3}|[jqxz]/);

