Create a separate JSON + syntax My code already works perfectly. Here is the JS file:

var movieData = {
   count: 6,
   movies: [{
       id: 1,
       title: "Lorem Ipsum",
       thumb: "assets/img/placehold.png"
     },
     {
       id: 2,
       title: "Lorem Ipsum",
       thumb: "assets/img/placehold.png"
     },
     {
       id: 3,
       title: "Lorem Ipsum",
       thumb: "assets/img/placehold.png"
     },
     {
      id: 4,
      title: "Lorem Ipsum",
      thumb: "assets/img/placehold.png"
    },
    {
      id: 5,
      title: "Lorem Ipsum",
      thumb: "assets/img/placehold.png"
    },
    {
      id: 6,
      title: "Lorem Ipsum",
      thumb: "assets/img/placehold.png"
    },
   ]
 };

 $(document).ready(function() {

    if (typeof movieData === 'object' &amp;&amp; typeof movieData !== null) {
      // List the movies
      for (var i in movieData.movies) {
         var movie = movieData.movies[i];
         var movieDiv = 

         '&lt;li class="movie-item" data-id="' + movie.id + '"&gt;' +
            '&lt;a href="#"&gt;' +
               '&lt;img src="' + movie.thumb + '" width="280" height="150" /&gt;' +
               '&lt;span class="text-content"&gt;&lt;i class="fa fa-chevron-up" aria-hidden="true"&gt;&lt;/i&gt;&lt;br&gt;&lt;br&gt;&lt;i class="fa fa-4x  fa-play-circle-o"&gt;&lt;/i&gt;&lt;br&gt;&lt;br&gt;' + movie.title + '&lt;/span&gt;&lt;/span&gt;' +
            '&lt;/a&gt;' +
         '&lt;/li&gt;';

         $('#films').append(movieDiv);
      }
    }

 });


I actually have everything into one file. As a code review I am asking your help if you have any idea about how to improve the code.

Knowing that as an improvement I already though about making this code into 2 different files (one JS and one JSON) but I would like to know your point of view.
I would recommend removing count if all it does is represent the number of items in movies. Otherwise, you'll have 2 sources of truth in the data (count and the length of movies) and code that takes sides down the line (one that believes in count and one that believes in the length of movies). So as much as possible, avoid duplicating data.

Now it's not always feasible to recompute data all the time (i.e. if you had to filter thousands of rows to count "selected" items). This is one case where I'd put a fixed number instead of recomputing it from some property. Just make sure it's documented somewhere.

for (var i in movieData.movies) {


Use regular for loops when looping through arrays. The problem with for-in is that it runs through all enumerable properties, indices and other enumerable properties. You might be getting more than what's just in the array. An even better suggestion is to use array.forEach.

$('#films').append(movieDiv);


The problem with this approach is that you're doing a jquery.append on every item. That means the browser has to re-render every time you add an item. What I suggest is to create a DOM element in memory and append to that in your loop. Then, at the very end, slap the contents of that DOM element onto the page once. This way, the browser only ever renders once.

// Creates a &lt;ul&gt; that's in memory, not yet appended to the DOM.
const replacementFilms = $('&lt;ul/&gt;', { id: '#films' })

movieData.movies.forEach(movie =&gt; {
  var movieDiv = '...the markup...'

  // Appends to our &lt;ul&gt; that's "in memory".
  replacementFilms.append(movieDiv)
})

// Replace the #films in the DOM with the one in memory in one go.
$('#films').replaceWith(replacementFilms)


In this example, I replaced the existing #films in the DOM. But you could also create a dummy element, append the items to it, then append its contents to a container element in the DOM. The operation doesn't have to be a total replace. But the idea is that you only ever touch the DOM once.

     '&lt;li class="movie-item" data-id="' + movie.id + '"&gt;' +
        '&lt;a href="#"&gt;' +
           '&lt;img src="' + movie.thumb + '" width="280" height="150" /&gt;' +
           '&lt;span class="text-content"&gt;&lt;i class="fa fa-chevron-up" aria-hidden="true"&gt;&lt;/i&gt;&lt;br&gt;&lt;br&gt;&lt;i class="fa fa-4x  fa-play-circle-o"&gt;&lt;/i&gt;&lt;br&gt;&lt;br&gt;' + movie.title + '&lt;/span&gt;&lt;/span&gt;' +
        '&lt;/a&gt;' +
     '&lt;/li&gt;';


See Template Literals for multi-line strings and string interpolation.