FIXED:

There is the following array:

var mainCategory = [elemen1, element2, element3] var secondCategory = [elemen4, element5, element6] var myArray = [ mainCategory, secondCategory] 

How to sort the array myArray to display in the following order on the page:

  • Main category: 1 element, 2 element, 3 element
  • Second category: 4th element, 5th element, 6th element

How can this be implemented in javascript.

Thank you in advance

  • The construction you specified in the question for the variable массив in the JavaScript language is missing. Write it in a working form. - user194374
  • I wrote in pseudo-language, just for clarity. - dborovsky
  • one
    You are requesting JavaScript code, but at the same time you are using pseudo language. Yes, and with typos. From the question it is not clear what is in your structure. Or do you think that we ourselves should understand where the objects are, where the arrays are, and where is something else? The implementation depends on the content. Two minuses on your question, I think, quite a noticeable sign that something is wrong with the question. - user194374
  • blame, fix - dborovsky
  • corrected, js not strong - dborovsky

0