If you have an array from php (maybe a collection from DB) and you want to use this data in Javascript, a simple solution would be
var jsArray = @json($array);
If you have an array from php (maybe a collection from DB) and you want to use this data in Javascript, a simple solution would be
var jsArray = @json($array);