JSFiddle - React, Tailwind, and code Playground

JavaScript

var input = [
    {
        testArr: [0, 1]
    },
    {
        testArr: [2, 3]
    }
];

var actualOutput = $.map(input, function (item, index) {
   return item.testArr; 
});
var expectedOutput = $.map(input, function (item, index) {
   //Why do I need to wrap it?
   return [item.testArr]; 
});

document.write('Actual: '+ JSON.stringify(actualOutput));
document.write('<br />');
document.write('Expected: '+ JSON.stringify(expectedOutput));