Some of these have alternative options. Only listing my preference here.
const simpleArray1: string[] = ["a", "b", "c"];
const simpleArray2: number[] = [1, 2, 3];
const simpleObject: { a: string; b: number } = { a: "a", b: 1 };
const combineArrays = (arr1: any[], arr2: any[]): any[] => {
return [...arr1, ...arr2];
};
This is why const makes sense here...
const sayNothing: Function = () => {};
type Gate = "AND" | "OR";
type GameBoardProps = {
id: number;
usernId: string;
gate: Gate;
condition: conditionFunc;
};
export type conditionFunc = (item: string) => boolean;
const usePageData = (page: number, fn: Function) => {
useEffect(() => {
console.log("your hook-needing behaviour in here");
fn(page);
}, []);
};