Hello, I have the following code:
$levels = $('input[name="Levels"]:checked + label'); levels = $levels.map(function() { return $(this).text(); }).get(); $theme.append(levels.join(", ")).append('<br />'); How can I replace the last comma in levels by " and "? I tried: levels.join(", ").replace(/, $/,'and ') This is not working. Could someone, please, help me? Thanks, Miguel