JSFiddle - React, Tailwind, and code Playground

by Andrey

JavaScript

let path = [1, 1, 0, 1];

let res = 'data';

path.forEach(item => {
	return res+`children[${item}]`
});
console.log(res);