Pushing new object and popping the first object of an Array of Objects in JavaScript

I am trying to create an array of object with always length five, so first push five objects, when the length of an array reach five then pop the first object and push the new object on the same array. And this operation will continue in a certain interval(On interval of 5 Sec).

   var arr = [{
    name: 'ABC', // Pop the first object when new object is push ..
   }, {
    name: 'ABC',
   }, {
    name: 'ABC',
   }, {
    name: 'ABC',
   }, {
    name: 'ABC',
   }];

arr.push({ name: 'ABCNew'});

Is this possible? Guys, pls guide me on how to achieve this functionality?

I would appreciate the help, Many thanks!

Source: New feed