An array of latest wp_titles

You can use the WordPress function wp_get_recent_posts(), with required args.

$output = array();

$args = array(
'numberposts' => 10,
'offset' => 0,
'category' => 0,
'orderby' => 'post_date',
'order' => 'DESC',
'include' => ,
'exclude' => ,
'meta_key' => ,
'meta_value' =>,
'post_type' => 'post',
'post_status' => 'draft, publish, future, pending, private',
'suppress_filters' => true );

$recent_posts = wp_get_recent_posts( $args, ARRAY_A );
foreach( $recent_posts as $post ) {
   $output[$post["ID"]]['title'] = $post["post_title"];
   $output[$post["ID"]]['title'] = get_permalink($post["ID"]);

}
add_action('wp_head', 'wpse158654_recent_posts');
function wpse158654_recent_posts() {?>
  <script type="text/javavscript">
   var recent_posts = <?php json_encode( $output ); ?>;
  </script>
}

Or you can use the wp_localize_script() function to print the variable for required js.

I haven’t tested the code, be careful if you are using it on live site directly.