Say I passed $param to sample.blade.php in Controller
(SampleController.php) public function index(Request $request){ return view('contents.sample')->with('param' => ['one', 'two', 'three']); }
Then in the blade file, all you have to do is just pass $param to js like this
(sample.blade.php) <script type="text/javascript"> var param = @json($param); alert(param); </script>