Issue on Loading Data From MySQL to JavaScript Array of Array Using jQuery Ajax

Issue on Loading Data From MySQL to JavaScript Array of Array Using jQuery Ajax

 I have a php and jquery code like below

  1.     <script>
  2.     $( document ).ready(function() {
  3.       var data =[];
  4.         $("#submit").on("click",function(){
  5.             $.ajax({
  6.                     type:"POST",
  7.                     url:"map.php",
  8.                     success: function (html) {
  9.                         $('#message').html(html);
  10.                     }
  11.             });
  12.         });
  13.     });
  14.     </script>

PHP

  1.     <?php
  2.     define ( 'DB_HOST', 'localhost' );
  3.     define ( 'DB_USER', 'root' );
  4.     define ( 'DB_PASS', '' );
  5.     define ( 'DB_NAME', 'test' );
  6.       $con = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);
  7.       $query = "SELECT x,y FROM app";
  8.       $results = $con->query($query);
  9.       $return = array();
  10.       if($results) {
  11.         while($row = $results->fetch_assoc()) {
  12.           $return[] = array((float)$row['x'],(float)$row['y']);
  13.         }
  14.       }
  15.        echo json_encode($return);
  16.       $con->close();
  17.      ?>

which return values from database like this in `$('#message').html(html);`

  1.     [ [ 20 , 20 ],[ 20 , 30 ],[ 50 , 35 ],[ 40 , 20 ] ]

now can you please let me know how I can parse/export/push this result into `data =[];` to have an array of array there so eventually the result must look like:

  1.     var data  =[ [ 20 , 20 ],[ 20 , 30 ],[ 50 , 35 ],[ 40 , 20 ] ];

Thanks