++[[]][+[]]+[+[]] = "10"
var a = [[]][+[]];var b = [+[]];
// so a == [] and b == [0]
++a;
// then a == 1 and b is still that array [0]// when you sum the var a and an array, it will sum b as a string just like that:
1 + "0" = "10"
const x = [], y = [];x.valueOf = () => (console.log('x.valueOf() has been called'), y.valueOf());x.toString = () => (console.log('x.toString() has been called'), y.toString());console.log(`+x -> ${+x}`);