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
MyProfile_Medalla.java
containsPalindrome
not worked!!
10 bottles of juice
Javascript Basics
prime consecutive numbers
Yes
More testing with JS
Tik
empty