function(e){if(!e||!Array.isArray(e)||!e.length||e.length<=2)return[];e=e.sort((e,t)=>e-t);let t=0,r=new Set([]);for(;t<=e.length-3&&!(e[t]>0);){for(;e[t]===e[t-1];)t+=1;let i=t+1,o=e.length-1;for(;i<o;){let n=e[t]+e[i]+e[o];if(n<0)for(i+=1;e[i]===e[i-1]&&i<o;)i+=1;else if(0===n){for(r.add([e[t],e[i],e[o]]),i++,o--;e[i]===e[i-1]&&i<o;)i++;for(;e[o]===e[o+1]&&i<o;)o--}else if(n>0)for(o--;e[o]===e[o+1]&&i<o;)o--}t+=1}return Array.from(r)}

result

[[-1,-1,2],[-1,0,1]]