Short random password generator

Today I wanted to implement a super short random password generator which is capable of generating an alphanumeric password of a fixed length (in this case 10 characters), with both uppercase and lowercase letters. The result is a self-invoking lambda-function.

The shortest I can come up with without using a minifier:

1
2
3
var x =(()=>{var a="abcdefghijklmnopqrstuvwxyz0123456789",l=10,r=Math.random,f=Math.floor,s=e="";for(var b=0;l>b;b++)e=a[f(r()*a.length)],1<2*r()&&(e=e.toUpperCase(),!0),s+=e;return s})();

console.log(x);        // eg. "43xww7X7Xn", "F0TfhVpSlz", "TqP057sMFb", ...

I’m using the comma-operator with a boolean operator to transform a random number of letters to uppercase: s>1&&(e=e.toUpperCase(),0!), which is equivalent to if (s > 1) { e = e.toUpperCase()}.