function compare(arr,styleName){ arr.sort((a,b)=>{ let x=a[styleName]; let y=b[styleName]; return x-y; }) }
function compare(a,b){ return a-b; }