This file contains hidden or 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
| /** | |
| * Gets all values from object regardless of their level of nesting | |
| */ | |
| export const getAllObjectValues = <T>(obj: { [key: string]: any }): T[] => { | |
| const values = []; | |
| for (let i = 0; i < Object.values(obj).length; i += 1) { | |
| const element = Object.values(obj)[i]; | |
| if (typeof element === "object" && element !== null) { | |
| values.push(...getAllObjectValues(element)); |
This file contains hidden or 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 { Component } from "react" | |
| type State = { | |
| count: number | |
| } | |
| type Props = { | |
| initialCount: number | |
| } |
This file contains hidden or 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
| { | |
| "extends": [ | |
| "react-app", | |
| "react-app/jest", | |
| "eslint:recommended", | |
| "plugin:@typescript-eslint/recommended", | |
| "prettier/@typescript-eslint", | |
| "plugin:prettier/recommended" | |
| ], | |
| "rules": { |
This file contains hidden or 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 cuisinesTemplate = { | |
| american: [], | |
| italian: [], | |
| french: [] | |
| } | |
| function serveBuffet(dishes) { | |
| const buffet = dishes.reduce((acc, dish) => { | |
| const cuisine = dish.cuisine.toLowerCase(); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.