Skip to content

Instantly share code, notes, and snippets.

View saravanapriyanm's full-sized avatar
🐞
Bugs... Bugs everywhere.

Saravanapriyan saravanapriyanm

🐞
Bugs... Bugs everywhere.
View GitHub Profile
@saravanapriyanm
saravanapriyanm / or-vs-includes.js
Last active September 6, 2021 07:39
JS Performance
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');
import {
Directive,
ElementRef,
EventEmitter,
Inject,
Input,
OnChanges,
OnDestroy,
OnInit,
Output,
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;
@saravanapriyanm
saravanapriyanm / cloudSettings
Last active December 14, 2021 13:32
VS code settings
{"lastUpload":"2021-12-14T13:32:29.298Z","extensionVersion":"v3.4.3"}