<script> let posts = @js($posts) // "posts" will now be a JavaScript array of post data from PHP. </script>