4.4 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			4.4 KiB
		
	
	
	
	
	
	
	
id, title, challengeType, videoUrl, localeTitle
| id | title | challengeType | videoUrl | localeTitle | 
|---|---|---|---|---|
| 587d8250367417b2b2512c60 | Create a Queue Class | 1 | Crear una clase de cola | 
Description
Instructions
Tests
tests:
  - text: Su clase de <code>Queue</code> debe tener un método de <code>enqueue</code> en <code>enqueue</code> .
    testString: 'assert((function(){var test = new Queue();  return (typeof test.enqueue === "function")}()), "Your <code>Queue</code> class should have a <code>enqueue</code> method.");'
  - text: Tu clase de <code>Queue</code> debe tener un método de <code>dequeue</code> .
    testString: 'assert((function(){var test = new Queue();  return (typeof test.dequeue === "function")}()), "Your <code>Queue</code> class should have a <code>dequeue</code> method.");'
  - text: Tu clase de <code>Queue</code> debe tener un método <code>front</code> .
    testString: 'assert((function(){var test = new Queue();  return (typeof test.front === "function")}()), "Your <code>Queue</code> class should have a <code>front</code> method.");'
  - text: Tu clase de <code>Queue</code> debe tener un método de <code>size</code> .
    testString: 'assert((function(){var test = new Queue();  return (typeof test.size === "function")}()), "Your <code>Queue</code> class should have a <code>size</code> method.");'
  - text: Tu clase de <code>Queue</code> debe tener un método <code>isEmpty</code> .
    testString: 'assert((function(){var test = new Queue();  return (typeof test.isEmpty === "function")}()), "Your <code>Queue</code> class should have an <code>isEmpty</code> method.");'
  - text: El método de <code>dequeue</code> debe eliminar y devolver el elemento frontal de la cola
    testString: 'assert((function(){var test = new Queue();  test.enqueue("Smith"); return (test.dequeue() === "Smith")}()), "The <code>dequeue</code> method should remove and return the front element of the queue");'
  - text: El método <code>front</code> debe devolver el valor del elemento frontal de la cola
    testString: 'assert((function(){var test = new Queue();  test.enqueue("Smith"); test.enqueue("John"); return (test.front() === "Smith")}()), "The <code>front</code> method should return value of the front element of the queue");'
  - text: El método de <code>size</code> debe devolver la longitud de la cola
    testString: 'assert((function(){var test = new Queue();  test.enqueue("Smith"); return (test.size() === 1)}()), "The <code>size</code> method should return the length of the queue");'
  - text: El método <code>isEmpty</code> debería devolver <code>false</code> si hay elementos en la cola
    testString: 'assert((function(){var test = new Queue();  test.enqueue("Smith"); return !(test.isEmpty())}()), "The <code>isEmpty</code> method should return <code>false</code> if there are elements in the queue");'
Challenge Seed
function Queue () {
    var collection = [];
    this.print = function() {
        console.log(collection);
    };
    // Only change code below this line
    // Only change code above this line
}
Solution
// solution required