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
// 2, 8, 10, 4, 3, 6, 7 | |
class Stack { | |
constructor() { | |
this.list = []; | |
this.pointer = 0; | |
} | |
push(value) { | |
this.list.push(value); |
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
// 2, 8, 10, 4, 3, 6, 7 | |
class Queue { | |
constructor() { | |
this.list = []; | |
this.pointer = 0; | |
} | |
enqueue(value) { | |
this.list.push(value); |
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
// 2 <-> 8 <-> 10 <-> 4 <-> 3 <-> 6 <-> 7 | |
// {prev, value, next} | |
class Node { | |
constructor(value) { | |
this.prev = null; | |
this.value = value; | |
this.next = null; |
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
// 2 -> 8 -> 10 -> 4 -> 7 | |
// {value, next} | |
class Node { | |
constructor(value) { | |
this.value = value; | |
this.next = null; | |
} |
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
// 2 -> 8 -> 10 -> 4 -> 7 | |
// {value, next} | |
class Node { | |
constructor(value) { | |
this.value = value; | |
this.next = null; | |
} | |
} |
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
import * as React from "react"; | |
const Text = (props) => { | |
return ( | |
<div style={{ border: "1px solid red", padding: "20px" }}> | |
<p>this is text</p> | |
<div>{props.children}</div> | |
</div> | |
); | |
}; |
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
{ | |
"editor.snippetSuggestions": "top", | |
"editor.suggestSelection": "first", | |
"editor.cursorSmoothCaretAnimation": false, | |
"editor.smoothScrolling": true, | |
"editor.fontSize": 14, | |
"editor.fontFamily": "Monaco", | |
"editor.fontWeight": "bold", | |
"editor.formatOnSave": true, | |
"emmet.triggerExpansionOnTab": true, |
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
// Typescript Documentation: | |
// https://www.typescriptlang.org/docs/ | |
// Basic Types | |
const message: string = "Hello world"; | |
const messageArr: Array<string> = [message]; | |
console.log(message); | |
console.log(messageArr); | |
const isValid: boolean = false; |
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
// https://npmcdn.com/@reactivex/[email protected]/dist/global/Rx.umd.js | |
Rx.Observable.create(function(observer) { | |
let counter = 0; | |
setInterval(function() { | |
observer.next((counter += 2)); | |
}, 2000); | |
}).subscribe( | |
function(val) { |
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
// users | |
const users = [ | |
{ | |
id: 0, | |
name: "Rocky" | |
}, | |
{ | |
id: 1, | |
name: "John" | |
}, |