My current task involves reordering a specific string of text, 'Set 1 Total Games Over/Under 9.5', using regex to make it read as 'Under/Over N Giochi Set 1'. The code snippet that achieves this is as follows:
let marketLabel = 'Set 1 Total Games Over/Under 9.5';
match = regexUnderOver.exec(marketLabel);
browserReturn = match[3] + '/' + match[2] + ' ' + match[4] + ' Giochi Set ' + match[1];
However, I am interested in implementing destructuring assignment to reorder the data more efficiently before assigning it to the 'browserReturn' variable. Despite attempting to follow MDN conventions, I find it challenging to grasp. If possible, could you demonstrate how I can achieve this using the example provided in the code below?
let marketLabel = 'Set 1 Total Games Over/Under 9.5';
const regexUnderOver = /^Set ([0-9.]+) Total Games (Over)\/(Under) ([0-9.]+)$/;
match = regexUnderOver.exec(marketLabel);
browserReturn = match[3] + '/' + match[2] + ' ' + match[4] + ' Giochi Set ' + match[1];
return browserReturn;