Did not work with json formats and the like, the task is to draw a binary tree with input data of type
{ data: { id: 'a', name: 'q', left: true, right: false } }, { data: { id: 'b', name: 'w', left: false, right: true } }, Something like this, in the task, the format of the data feed is not specified, it may not be necessary in any form in json, it is possible and js objects. 
this should come out, but it is not necessary to impose all this strongly, I will be glad if you give up logic, I will try to finish
[ [ [] [] ] [ [] [] ] ]are completely different things - MedvedevDev