This file contains 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
{ | |
"short_name": "React App", | |
"name": "Create React App Sample", | |
"icons": [ | |
{ | |
"src": "favicon.ico", | |
"sizes": "64x64 32x32 24x24 16x16", | |
"type": "image/x-icon" | |
} | |
], |
This file contains 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
{ | |
"name": "Chrome Extension React", | |
"version": "1.0", | |
"manifest_version": 2, | |
"browser_action": { | |
"default_popup": "index.html" | |
} | |
} |
This file contains 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
{ | |
"name": "Chrome Extension React", | |
"version": "1.0", | |
"manifest_version": 2, | |
"browser_action": { | |
"default_popup": "index.html" | |
}, | |
"content_security_policy": "script-src 'self' 'sha256-[YOUR_KEY_HERE]'; object-src 'self'" | |
} |
This file contains 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 a = 1; | |
let b = 2; | |
let c = a + b; | |
console.log('c = ', c); | |
//Output: c = 3 | |
a = 2; | |
console.log('c = ', c); | |
//Output: c = 3 |
This file contains 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 a = 1; | |
let b = 2; | |
let c = a + b; | |
console.log('c = ', c); | |
//Output: c = 3 | |
a = 2; | |
console.log('c = ', c); | |
//Output: c = 4 |
This file contains 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
function Click() { | |
this.handlers = []; // observers | |
} | |
Click.prototype = { | |
subscribe: (fn) => { | |
this.handlers.push(fn); | |
}, | |
unsubscribe: (fn) => { | |
this.handlers = this.handlers.filter(...); |
This file contains 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
var Iterator = function(items) { | |
this.index = 0; | |
this.items = items; | |
} | |
Iterator.prototype = { | |
first: () => { | |
this.reset(); | |
return this.next(); | |
}, |
This file contains 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
// create observable | |
const exampleObservable$ = new Observable((observer) => { | |
// observable execution | |
observer.next('example value 1'); | |
observer.next('example value 2'); | |
observer.next('example value 3’); | |
observer.complete(); | |
}) |
This file contains 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
const bubbleSort = (inputArr) => { | |
let length = inputArr.length; | |
for (let i = 0; i < length; i++) { | |
for (let j = 0; j < length; j++) { | |
if (inputArr[j] > inputArr[j + 1]) { | |
let tmp = inputArr[j]; | |
inputArr[j] = inputArr[j + 1]; | |
inputArr[j + 1] = tmp; | |
} | |
} |
This file contains 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
function selectionSort(array) { | |
for (var i = 0; i < array.length; i++) { | |
let min = i; // storing the index of minimum element | |
for (var j = i + 1; j < array.length; j++) { | |
if (array[min] > array[j]) { | |
min = j; // updating the index of minimum element | |
} |