Skip to content

Instantly share code, notes, and snippets.

View kennethkeim's full-sized avatar

Kenneth Keim kennethkeim

View GitHub Profile
@kennethkeim
kennethkeim / michael-lowdash.ts
Last active December 2, 2022 22:34
Credits to Michael Lowenstein
export const defaultTo = (a: any, b: any): any =>
a == null || Object.is(a, NaN) ? b : a;
export const remove = (data: any[], loopFunc: any): any[] => {
return data.filter(() => {
return !loopFunc.apply(this);
});
};
export const omitThis = (key: string, { [key]: _, ...obj }) => obj;