🧑💻
Probably coding with some music on...
Javascript developer working on nodejs and front framework like react and AWS stack
Pinned Loading
-
SpreadWithTypeofGuard
SpreadWithTypeofGuard 1const val1 = {
2test1: 1,
3test2: 2,
4}5const result = { ...(typeof val1 === 'object' ? val1 : {})}
-
Function overload
Function overload 1// Overload signatures2function greet(person: string): string;
3function greet(persons: string[]): string[];
45// Implementation signature -
proxyValidator
proxyValidator 1const validator = {
2set: function(obj, prop, value) {
3if (prop === 'age' && typeof value !== 'number') {
4throw new Error('Age must be a number');
5} -
lookup table
lookup table 1const I18N_PREFIX = 'form.formValidation';
2export enum RequestStatus {
3PENDING = 'pending',
4SUCCESS = 'success',
5ERROR = 'error',
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.



