JSFiddle - React, Tailwind, and code Playground

JavaScript

var tab=[];
tab["010"]=2;
tab["012"]=8;
tab["014"]=4;
tab["110"]=2;
tab["112"]=8;
tab["114"]=4;

var keys= Object.keys(tab);

function mysort(a,b){
return ( +a >= +b)? 1 : -1;
}

keys.sort(mysort);

keys.forEach ( function( idx, val){
console.log( idx  )} )