{"id":19632798,"url":"https://github.com/shubhamd99/typescript-generics-example","last_synced_at":"2026-05-15T22:01:46.685Z","repository":{"id":122001925,"uuid":"252966144","full_name":"shubhamd99/typescript-generics-example","owner":"shubhamd99","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-25T05:20:57.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-30T22:44:32.047Z","etag":null,"topics":["javascript","typescript","typescript-generics"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shubhamd99.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-04-04T10:20:58.000Z","updated_at":"2021-01-25T05:20:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"5326fc6c-f278-45b7-a315-5f6911a95883","html_url":"https://github.com/shubhamd99/typescript-generics-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shubhamd99/typescript-generics-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamd99%2Ftypescript-generics-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamd99%2Ftypescript-generics-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamd99%2Ftypescript-generics-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamd99%2Ftypescript-generics-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shubhamd99","download_url":"https://codeload.github.com/shubhamd99/typescript-generics-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamd99%2Ftypescript-generics-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281896642,"owners_count":26580138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","typescript","typescript-generics"],"created_at":"2024-11-11T12:15:27.374Z","updated_at":"2025-10-30T22:44:35.508Z","avatar_url":"https://github.com/shubhamd99.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### Typescript Generics\n* TypeScript extends JavaScript by adding types to the language.\n* TypeScript speeds up your development experience by catching errors and providing fixes before you even run your code.\n\n* Sometimes you come across a situation to repeat the same block of code for different types. So, instead of writing repeated blocks of code, generics let you write a generalized form of method.\n\n* i.e Functions, Interfaces, Classes\n* Code that accepts type parameters for each instance or invocation.\n\n#### Implements\n* The new class can be treated as the same \"shape\", while it is not a child. It could be passed to any method where the Person is required, regardless of having different parent than Person\n\n#### Extends\nThe new class is a child. It gets benefits coming with inheritance. It has all properties, methods as its parent. It can override some of these and implement new, but the parent stuff is already included.\n\n![vscode](https://i.imgur.com/2NVleV3.png)\n\n\n```\n npx ts-node CompareTwoArrays.ts\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhamd99%2Ftypescript-generics-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshubhamd99%2Ftypescript-generics-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhamd99%2Ftypescript-generics-example/lists"}