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
Tyu
Alternating Sign Fibonacci
More JS
//Rhino 1.7.7.1print("Hello, world!")
linq-style in javascript
Futbal
1
fb_series
replaceMethod
GCD