sorted two dimensional array data structure in Javascript programming language