Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
class Stack
class Stack { constructor() { this.values = []; } push(value) { this.values.push(value) } pop() { return this.values.pop(); } peek() { return this.values[this.values.length - 1]; } isEmpty() { return this.values.length === 0; } } let stack = new Stack(); console.log(stack.isEmpty()); stack.push(3) console.log(stack.peek()); console.log(stack.isEmpty()); console.log(stack.pop()); console.log(stack.isEmpty());
run
|
edit
|
history
|
help
0
merge json array objects based on ID
Daddy
Rocket Science
ROSHAMBO BITCHES!
rotateMatrix
Star wars ep 3. limit
Javascript Basics
My first app
I love sorting
test