Dear dancer experts,
                               I have a 1D Perl array which I would like to encode using JSON and send it as a response to an ajax request. 

I have implemented the following steps so far in my dancer app: 

use Dancer::Plugin::Ajax;
set serializer => 'JSON';

ajax '/getarray' => sub {

    my @sendArray;
      ...........  
   {
       @sendArray;  # this is the array I intend to send to the client Java Script
   }
  
};

 The sendArray is not a (key, value) pair based structure, but a simple 1D array.
 Can anyone let me know if  "@sendArray" statement at the end of  ajax routine above will correctly encode to JSON?

Also is there any way to print (to console) the final encoded JSON object from the ajax routine at the server end? 

thanks in advance
\amk