Having Issue on Wrapping Last <td> of Each Row in ( ) on The Fly

Having Issue on Wrapping Last <td> of Each Row in ( ) on The Fly


I am trying to load each row of a table in element of an array using this code

  1. var arr = [];
  2. $('#authors tr').each(function () {
  3.     arr.push($(this).text().trim().replace(/(\n)/g, ','));
  4. });
  5. console.log(arr);

But I need to wrap the last <td> of each row in ( ) then I tried to add () like this


  1.     $(this).find('td:last').before( "(" );
  2.      $(this).find('td:last').after( ")" );

This is doing the job but it actually adding () to the table which is not required.  Now can you please let me know how to do this without adding character to the actual table?