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 stat = 'Pending'; | |
console.time('OR'); | |
console.log(stat === 'Pending' || stat === 'No Tweets Found' || stat === 'Error. Please retry.') | |
console.timeEnd('OR'); | |
// Faster & Shorter | |
console.time('includes'); | |
console.log(['Pending', 'No Tweets Found', 'Error. Please retry.'].includes(stat)) | |
console.timeEnd('includes'); |
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
// Sum of even Fibonacci numbers that doesn't exceed 40 | |
let prev = 1; | |
let curr = 1; | |
let sumOfEven = 0; | |
for(let i=0; curr <= 40; i++){ | |
if(curr % 2 === 0){ | |
sumOfEven += curr; | |
} | |
console.log(curr); |
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
{"lastUpload":"2021-12-14T13:32:29.298Z","extensionVersion":"v3.4.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
// Promise | |
return new Promise((resolve, reject) => { | |
resolve(true); | |
}); | |
// RxJs Observable | |
return new Observable(subscriber => { | |
subscriber.next(true); | |
subscriber.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
console.log() |
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
import { | |
Directive, | |
ElementRef, | |
EventEmitter, | |
Inject, | |
Input, | |
OnChanges, | |
OnDestroy, | |
OnInit, | |
Output, |
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
enum Claims { | |
viewPage1 = 1<<0, | |
editPage1 = 1<<1, | |
approvePage1 = 1<<2, | |
viewPage2 = 1<<3, | |
editPage2 = 1<<4, | |
approvePage2 = 1<<5, | |
} | |
const dashboardBuilder = Claims.viewPage1 + Claims.editPage1 + Claims.approvePage1; |
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
/^[\u0b80-\u0bff]+$/.test("யாத்திராகமம்"); |
#Angular CLI commands
Lazy loading module with routing and 1 component
ng generate module customers --route customers --module app.module
OlderNewer