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
Nombre en MAYÚSCULAS
on_off
Tik
replaceMethod.js
Lovedek_ellovesi_tavolsag_kalkulator
ComposeWordsGrid
black peepz ping pong
Fixed
my dick!!!
123