-
-
Save nairihar/fd6d35faa8f481da97aae51ef4e16fd2 to your computer and use it in GitHub Desktop.
Optym internship 1.2, Stack and Q examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myQ = Q(); | |
myQ.push(1); | |
myQ.push(2); | |
myQ.push(3); | |
console.log(myQ.pop()); // 1 | |
console.log(myQ.pop()); // 2 | |
console.log(myQ.pop()); // 3 | |
let myQ222222 = Q(); | |
myQ222222.push(1); | |
myQ.push(4); | |
console.log(myQ222222.pop()); // 1 | |
console.log(myQ.pop()); // 4 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myStack = Stack(); | |
myStack.push(1); | |
myStack.push(2); | |
myStack.push(3); | |
console.log(myStack.pop()); // 3 | |
console.log(myStack.pop()); // 2 | |
console.log(myStack.pop()); // 1 | |
let myStack222222 = Stack(); | |
myStack222222.push(1); | |
myStack.push(4); | |
console.log(myStack222222.pop()); // 1 | |
console.log(myStack.pop()); // 4 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment