Escaping Data

Escaping Data

What is the best way to escape data? I have values which will be coming out of a database and need the ' & " to stay intact. I've tried replacing them with HTML values etc but they don't render right...

  1.                     <script type="text/javascript">
  2. const data = [
  3.                                 ['AM STD 3x6 ID BLUE BKGD FACE||DWG AS090292||', '1', 'A', '22990461', '2020-04-06', '2020-03-11', '5', '', '0000-00-00', '0000-00-00', '0'],
  4. ['AMOCO 1'9x4'4 TOGO SF CTS SGN(NO LEAF)||DWG BP1024SF_LDSV||FACE: BP184910||', '1', 'A', '35522430', '2020-01-21', '2020-01-02', '5', '•1/20-This will be completed 1/21.', '2020-01-21', '2020-01-21', '1'],

  5. ];
  6. const container = document.getElementById('productionLogTable');
  7. const hot = new Handsontable(container, {
  8.   data: data,
  9.   colHeaders: ['Description', 'Qty', 'LN #', 'Order Number', 'AS400 Ship Date', 'Date Showed on Report', 'Days to Manufacture', 'Notes', 'Date Shown Completed', 'Actual Ship Date', 'Qty Shipped'],
  10.   colWidths: [300, 70, 70, 110, 110, 90, 90, 300, 90, 90],
  11.   rowHeaders: true,
  12.   headerTooltips: {
  13.   columns: true,
  14.   onlyTrimmed: true
  15.   },
  16.   filters: true,
  17.   dropdownMenu: true,
  18. });
  19. </script>
This is the record causing issues...

  1. ['AMOCO 1'9x4'4 TOGO SF CTS SGN(NO LEAF)||DWG BP1024SF_LDSV||FACE: BP184910||', '1', 'A', '35522430', '2020-01-21', '2020-01-02', '5', '•1/20-This will be completed 1/21.', '2020-01-21', '2020-01-21', '1'],