JavaScript breadth-first search algorithm
Just going to make a few comment on your Queue implementation.


  Should your data be an object this.data = {};?


This is a matter of taste, but I would have opted for an array or a linkedlist data structure if I were you. Using an array, you can easily push items without a key . From my perspective ,you are basically passing the same name for the key/value pair in the enqueue.


  How to retrieve the total number of items enqueued?


I believe your class should  data should only be private to your class. hence the data count should be accessed using a getter function e.g 

this.count = function() {
    return this.data.length;
  };



  What should your enqueue look like? 


basically, your Queue class is not reusable as it's dependent on having key/value pair has an input. I reckon the enqueue function should take only one value .  In this case John. A pseudocode 

    enqueue(value) {
      // created an empty if statement - note if value is undefined this will evaluate to true as well as null ==null
      if (value == null);
      else {
        if ( //data enqueued has exceeded the current array length) {
          let newcapacity = Math.floor(this.count() * this.growfactor / 100);
          // create a new array with the capacity and copy the old array elements to a new one.
        }

        this.size++;
        // assign the item to an empty index 
        this.data[index] = value;
      }
    }
    }




Although, the above is more or less a C# equivalent but the main idea is you only enqueue items when they are not null/undefined - hence I used == as opposed to === as undefined== null results in true and null==null results in true . This is equivalent to

if ( typeof(some_variable) !== "undefined" &amp;&amp; some_variable !== null ) {}


The newCapacity is simply a strategy to increase the size of an array.


  How to easily delete an item using an array?


Constantly, you need to check if your array's size is zero then throw an exception else call the array's shift() function to delete the first item and update the array.

dequeue() {
  if (size === 0) {
    throw "the queue contains no items";
  }
  this.data.shift();
}



  Note: there are some very useful Queue functions that can be added to your class : 



peek() : returns the first item in the queue
contains : Check if an item exist
isempty()- checks if an item is empty


I hope this helps.