Home > front end >  The array stratified
The array stratified

Time:03-26

I have a call the hs array, there are h1, h2 and h3 element, such as:
[h1, h1, h2, h2, h2, h1, h2, h3, h3, h2]
How to put it into the layers below?
[h1, h1, h2, h2, h2], h1, [h2, h3, h3], h2]]
Then an array to save it as a tocList,
Thank you very much!

CodePudding user response:

Don't see any rule, you want to ask questions, please describe the problem clearly,

CodePudding user response:

Is the same element (h1 and h1, h2 and h2) belong to the same level of array, like this:
H1
H1
The h2
The h2
The h2
H1
The h2
H3
H3
The h2
This way,

CodePudding user response:

Have to help you achieve, remind me to give you the code tomorrow,

CodePudding user response:

refer to the second floor twist twist 105 response:
element is the same (h1 and h1, h2 and h2) belong to the same level of array, like this:
H1
H1
The h2
The h2
The h2
H1
The h2
H3
H3
The h2
This way,


You should be to want to say, the same for continuous together?? The results of your examples should be:
[h1, h1, h2, h2, h2], h1, h2, h3, h3], h2]

Rather than

[h1, h1, h2, h2, h2], h1, [h2, [h3, h3], h2]]

CodePudding user response:

The same level? Based on an element for the first time in order to level it is in?
  • Related