I am looking to generate a 3D array from a 1D array that I have.
let a = ['hello', 'my', 'friend']
I attempted to create the 3D array with the following code:
b = [[['h'], ['e'], ['l'], ['l'], ['o']], [['m'], ['y']], [['f'], ['r'], ['i'] ,['e'], ['n'], ['d']]]
Unfortunately, it did not work as expected.
Can anyone provide guidance on how to achieve this?