Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
class Queue
class Queue { constructor() { this.values = []; } add(value) { this.values.push(value) } remove() { return this.values.shift(); } peek() { return this.values[0]; } isEmpty() { return this.values.length === 0; } } let queue = new Queue(); console.log(queue.isEmpty()); queue.add(3) queue.add(4) console.log(queue.peek()); console.log(queue.isEmpty()); console.log(queue.remove()); console.log(queue.isEmpty());
run
|
edit
|
history
|
help
0
Star wars ep 3. limit
Javascript Closure
a pipeline generator
zeroMatrix
Time it has been since Tuesday, January 1st, 2019
challenge
Functions
single_digit
Узнать день недели из двух дат
Alternating Sign Fibonacci