title: Laravel JavaScript passing an array from backend to a array in JavaScript
body: <p>I have a controller that passes a array to the blade file call it <em>$data</em> From there I echo the data to the page via blade like <em>{{ $data[0]['name] }}</em></p>
  
  <p>The problem is I also want the data to be inside an array in javascript.</p>
  
  <p>How can this be accomplished?
  Is it best to just request the data again via AJAX or is there a way to get the data out of blade and into javascript. Or possible rendering it to html in JSON via Blade then pulling the JSON from the html in JavaScript </p>