2 line simple ES -6 solution. Please comment for any further clarification


#1

largestNumber : function(A){
let arr = A.sort((a,b)=>a+’’+b<b+’’+a?1:-1).join(’’);
// Used ‘==’ instead of ‘===’ to avoid typecasting in case of ‘00000’
return arr==0?0:arr;
}