It’s a new feature that introduced in ES6 and is called arrow function. The left part denotes the input of a function and the right part the output of that function.
So in your case
s.split('')
splits the input on empty spaces and for each element of the resulted array you apply the following function:
(x,index) => x.toUpperCase()+Array(index+1).join(x.toLowerCase())
The left part is the random element, x
of the array (s.split('')
) and it’s corresponding index. The second part applies a transformation to this input.