Convert each element of array into separate array and push into one array.
inputArray = ['One', 'Two', 'Three']
Required Output
outputArray = [['One'],['Two'],['Three']]
By using ES6 how to get this output?
You an use array.map to do that:
const inputArray = ['One', 'Two', 'Three'];
const result = inputArray.map(x => [x]);
console.log(result);