{"id":3248,"date":"2020-07-13T08:52:00","date_gmt":"2020-07-13T08:52:00","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/generics-in-typescript\/"},"modified":"2026-04-24T11:39:03","modified_gmt":"2026-04-24T11:39:03","slug":"%d8%a7%d9%84%d8%a3%d8%ac%d9%86%d8%a7%d8%b3-%d9%81%d9%8a-%d8%a7%d9%84%d9%85%d8%ae%d8%b7%d9%88%d8%b7%d8%a7%d8%aa-%d8%a7%d9%84%d9%85%d8%b7%d8%a8%d9%88%d8%b9%d8%a9","status":"publish","type":"post","link":"https:\/\/thecodest.co\/ar\/blog\/generics-in-typescript\/","title":{"rendered":"\u0627\u0644\u062c\u064a\u0646\u0627\u062a \u0641\u064a TypeScript"},"content":{"rendered":"<p>\u064a\u0645\u0643\u0646 \u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0627\u0644\u0623\u062c\u0646\u0627\u0633 \u0627\u0644\u0639\u0627\u0645\u0629 \u0628\u0627\u0644\u0627\u0642\u062a\u0631\u0627\u0646 \u0645\u0639 \u0627\u0644\u062f\u0648\u0627\u0644 (\u0625\u0646\u0634\u0627\u0621 \u062f\u0627\u0644\u0629 \u0639\u0627\u0645\u0629)\u060c \u0648\u0627\u0644\u0641\u0626\u0627\u062a (\u0625\u0646\u0634\u0627\u0621 \u0641\u0626\u0629 \u0639\u0627\u0645\u0629)\u060c \u0648\u0627\u0644\u0648\u0627\u062c\u0647\u0627\u062a (\u0625\u0646\u0634\u0627\u0621 \u0648\u0627\u062c\u0647\u0629 \u0639\u0627\u0645\u0629).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u0627\u0644\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0627\u0644\u0623\u0633\u0627\u0633\u064a<\/h2>\n\n\n\n<p>\u0639\u0644\u0649 \u0627\u0644\u0623\u0631\u062c\u062d \u0623\u0646\u0643 \u0627\u0633\u062a\u062e\u062f\u0645\u062a \u0627\u0644\u0623\u062c\u0646\u0627\u0633 \u0627\u0644\u0639\u0627\u0645\u0629 \u0641\u064a \u0627\u0644\u0645\u0627\u0636\u064a \u062d\u062a\u0649 \u062f\u0648\u0646 \u0645\u0639\u0631\u0641\u0629 \u0630\u0644\u0643 - \u0627\u0644\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0627\u0644\u0623\u0643\u062b\u0631 \u0634\u064a\u0648\u0639\u064b\u0627 \u0644\u0644\u0623\u062c\u0646\u0627\u0633 \u0627\u0644\u0639\u0627\u0645\u0629 \u0647\u0648 \u0625\u0639\u0644\u0627\u0646 \u0645\u0635\u0641\u0648\u0641\u0629:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">const myArray: \u0633\u0644\u0633\u0644\u0629[];<\/code><\/pre>\n\n\n\n<p>\u0644\u0627 \u064a\u0628\u062f\u0648 \u0627\u0644\u0623\u0645\u0631 \u0645\u0645\u064a\u0632\u0627\u064b \u062c\u062f\u0627\u064b \u0644\u0644\u0648\u0647\u0644\u0629 \u0627\u0644\u0623\u0648\u0644\u0649\u060c \u0646\u062d\u0646 \u0646\u0639\u0644\u0646 \u0641\u0642\u0637 <code>\u0645\u0635\u0641\u0648\u0641\u062a\u064a<\/code> \u0643\u0645\u0635\u0641\u0648\u0641\u0629 \u0645\u0646 \u0627\u0644\u0633\u0644\u0627\u0633\u0644\u060c \u0648\u0644\u0643\u0646\u0651\u0647 \u0646\u0641\u0633 \u0627\u0644\u062a\u0639\u0631\u064a\u0641 \u0627\u0644\u0639\u0627\u0645:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">const myArray: \u0645\u0635\u0641\u0648\u0641\u0629 ;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u0625\u0628\u0642\u0627\u0621 \u0627\u0644\u0623\u0645\u0648\u0631 \u0648\u0627\u0636\u062d\u0629<\/h2>\n\n\n\n<p>\u062f\u0639\u0646\u0627 \u0646\u0628\u062f\u0623 \u0628\u0645\u062b\u0627\u0644 \u0628\u0633\u064a\u0637 \u0644\u0644\u063a\u0627\u064a\u0629 - \u0643\u064a\u0641 \u064a\u0645\u0643\u0646\u0646\u0627 \u0646\u0642\u0644 \u0647\u0630\u0647 \u0627\u0644\u0641\u0627\u0646\u064a\u0644\u064a\u0627 <a href=\"https:\/\/thecodest.co\/ar\/blog\/hire-vue-js-developers\/\">\u0627\u0644\u0634\u0628\u064a\u0628\u0629<\/a> \u0627\u0644\u062f\u0627\u0644\u0629 \u0625\u0644\u0649 <a href=\"https:\/\/thecodest.co\/ar\/dictionary\/typescript-developer\/\">TypeScript<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\u062f\u0627\u0644\u0629 getPrefiledArray(\u062d\u0634\u0648\u060c \u0637\u0648\u0644) {\n    \u0625\u0631\u062c\u0627\u0639 (\u0645\u0635\u0641\u0648\u0641\u0629 \u062c\u062f\u064a\u062f\u0629 (\u0627\u0644\u0637\u0648\u0644)).filler(filler);\n}<\/code><\/pre>\n\n\n\n<p>\u0633\u062a\u064f\u0639\u064a\u062f \u0647\u0630\u0647 \u0627\u0644\u062f\u0627\u0644\u0629 \u0645\u0635\u0641\u0648\u0641\u0629 \u0645\u0645\u0644\u0648\u0621\u0629 \u0628\u0643\u0645\u064a\u0629 \u0645\u062d\u062f\u062f\u0629 \u0645\u0646 <code>\u062d\u0634\u0648<\/code>\u0644\u0630\u0627\u060c \u0641\u0625\u0646 <code>\u0627\u0644\u0637\u0648\u0644<\/code> \u0633\u064a\u0643\u0648\u0646 <code>\u0627\u0644\u0639\u062f\u062f<\/code> \u0648\u0633\u062a\u0639\u064a\u062f \u0627\u0644\u062f\u0627\u0644\u0629 \u0628\u0623\u0643\u0645\u0644\u0647\u0627 \u0645\u0635\u0641\u0648\u0641\u0629 \u0645\u0646 <code>\u062d\u0634\u0648<\/code> - \u0648\u0644\u0643\u0646 \u0645\u0627 \u0647\u0648 \u0627\u0644\u062d\u0634\u0648\u061f \u0641\u064a \u0647\u0630\u0647 \u0627\u0644\u0645\u0631\u062d\u0644\u0629 \u064a\u0645\u0643\u0646 \u0623\u0646 \u064a\u0643\u0648\u0646 \u0623\u064a \u0634\u064a\u0621\u060c \u0644\u0630\u0627 \u0641\u0625\u0646 \u0623\u062d\u062f \u0627\u0644\u062e\u064a\u0627\u0631\u0627\u062a \u0647\u0648 \u0627\u0633\u062a\u062e\u062f\u0627\u0645 <code>\u0623\u064a<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\u062f\u0627\u0644\u0629 getPrefiledArray(\u0627\u0644\u062d\u0634\u0648: \u0623\u064a\u060c \u0627\u0644\u0637\u0648\u0644: \u0631\u0642\u0645): \u0623\u064a[] {\n    \u0625\u0631\u062c\u0627\u0639 (\u0645\u0635\u0641\u0648\u0641\u0629 \u062c\u062f\u064a\u062f\u0629 (\u0627\u0644\u0637\u0648\u0644)).\u0645\u0644\u0621 (\u062d\u0634\u0648);\n}<\/code><\/pre>\n\n\n\n<p>\u0627\u0633\u062a\u062e\u062f\u0627\u0645 <code>\u0623\u064a<\/code> \u0639\u0627\u0645 \u0628\u0627\u0644\u062a\u0623\u0643\u064a\u062f - \u064a\u0645\u0643\u0646\u0646\u0627 \u062a\u0645\u0631\u064a\u0631 \u0623\u064a \u0634\u064a\u0621 \u062d\u0631\u0641\u064a\u064b\u0627\u060c \u0644\u0630\u0627 \u0641\u0625\u0646 \"\u0627\u0644\u0639\u0645\u0644 \u0645\u0639 \u0639\u062f\u062f \u0645\u0646 \u0627\u0644\u0623\u0646\u0648\u0627\u0639 \u0628\u062f\u0644\u064b\u0627 \u0645\u0646 \u0646\u0648\u0639 \u0648\u0627\u062d\u062f\" \u0645\u0646 \u0627\u0644\u062a\u0639\u0631\u064a\u0641 \u0645\u063a\u0637\u0649 \u0628\u0627\u0644\u0643\u0627\u0645\u0644\u060c \u0648\u0644\u0643\u0646\u0646\u0627 \u0646\u0641\u0642\u062f \u0627\u0644\u0635\u0644\u0629 \u0628\u064a\u0646 <code>\u062d\u0634\u0648<\/code> \u0648\u0646\u0648\u0639 \u0627\u0644\u0625\u0631\u062c\u0627\u0639. \u0641\u064a \u0647\u0630\u0647 \u0627\u0644\u062d\u0627\u0644\u0629\u060c \u0646\u0631\u064a\u062f \u0625\u0631\u062c\u0627\u0639 \u0634\u064a\u0621 \u0634\u0627\u0626\u0639\u060c \u0648\u064a\u0645\u0643\u0646\u0646\u0627 \u062a\u0639\u0631\u064a\u0641 \u0647\u0630\u0627 \u0627\u0644\u0634\u064a\u0621 \u0627\u0644\u0634\u0627\u0626\u0639 \u0635\u0631\u0627\u062d\u0629\u064b \u0639\u0644\u0649 \u0623\u0646\u0647 <strong>\u0645\u0639\u0644\u0645\u0629 \u0627\u0644\u0646\u0648\u0639<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\u062f\u0627\u0644\u0629 getPrefiledArray(\u0627\u0644\u062d\u0634\u0648: T\u060c \u0627\u0644\u0637\u0648\u0644: \u0631\u0642\u0645): T[] {\n    \u0625\u0631\u062c\u0627\u0639 (\u0645\u0635\u0641\u0648\u0641\u0629 \u062c\u062f\u064a\u062f\u0629 (\u0627\u0644\u0637\u0648\u0644)).filler(\u062d\u0634\u0648);\n}<\/code><\/pre>\n\n\n\n<p>\u0648\u0627\u0633\u062a\u062e\u062f\u0627\u0645\u0647\u0627 \u0647\u0643\u0630\u0627:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">const prefilledArray = getPrefiledArray(0, 10);<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u0627\u0644\u0642\u064a\u0648\u062f \u0627\u0644\u0639\u0627\u0645\u0629<\/h2>\n\n\n\n<p>\u0644\u0646\u0646\u0638\u0631 \u0625\u0644\u0649 \u062d\u0627\u0644\u0627\u062a \u0645\u062e\u062a\u0644\u0641\u0629 \u0631\u0628\u0645\u0627 \u0623\u0643\u062b\u0631 \u0634\u064a\u0648\u0639\u064b\u0627. \u0644\u0645\u0627\u0630\u0627 \u0646\u0633\u062a\u062e\u062f\u0645 \u0627\u0644\u0623\u0646\u0648\u0627\u0639 \u0641\u064a \u0627\u0644\u062f\u0648\u0627\u0644\u061f \u0628\u0627\u0644\u0646\u0633\u0628\u0629 \u0644\u064a\u060c \u0647\u0648 \u0644\u0644\u062a\u0623\u0643\u062f \u0645\u0646 \u0623\u0646 \u0627\u0644\u0648\u0633\u064a\u0637\u0627\u062a \u0627\u0644\u062a\u064a \u062a\u0645\u0631\u0631 \u0625\u0644\u0649 \u0627\u0644\u062f\u0627\u0644\u0629 \u0633\u064a\u0643\u0648\u0646 \u0644\u0647\u0627 \u0628\u0639\u0636 \u0627\u0644\u062e\u0635\u0627\u0626\u0635 \u0627\u0644\u062a\u064a \u0623\u0631\u064a\u062f \u0627\u0644\u062a\u0641\u0627\u0639\u0644 \u0645\u0639\u0647\u0627.<\/p>\n\n\n\n<p>\u0645\u0631\u0629 \u0623\u062e\u0631\u0649 \u062f\u0639\u0646\u0627 \u0646\u062d\u0627\u0648\u0644 \u0646\u0642\u0644 \u062f\u0627\u0644\u0629 \u0627\u0644\u0641\u0627\u0646\u064a\u0644\u0627 JS \u0627\u0644\u0628\u0633\u064a\u0637\u0629 \u0625\u0644\u0649 TS.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\u062f\u0627\u0644\u0629 getLength(\u0627\u0644\u0634\u064a\u0621) {\n    \u0625\u0631\u062c\u0627\u0639 \u0637\u0648\u0644 \u0627\u0644\u0634\u064a\u0621;\n}<\/code><\/pre>\n\n\n\n<p>\u0644\u062f\u064a\u0646\u0627 \u0645\u0639\u0636\u0644\u0629 \u063a\u064a\u0631 \u0628\u062f\u064a\u0647\u064a\u0629 - \u0643\u064a\u0641 \u0646\u062a\u0623\u0643\u062f \u0645\u0646 \u0623\u0646 \u0627\u0644\u0634\u064a\u0621 \u0644\u062f\u064a\u0647 <code>\u0627\u0644\u0637\u0648\u0644<\/code> \u0627\u0644\u0645\u0644\u0643\u064a\u0629\u060c \u0648\u0642\u062f \u062a\u0643\u0648\u0646 \u0627\u0644\u0641\u0643\u0631\u0629 \u0627\u0644\u0623\u0648\u0644\u0649 \u0647\u064a \u0627\u0644\u0642\u064a\u0627\u0645 \u0628\u0634\u064a\u0621 \u0645\u062b\u0644:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\u062f\u0627\u0644\u0629 getLength(\u0627\u0644\u0634\u064a\u0621: \u0646\u0648\u0639 \u0645\u0646 \u0627\u0644\u0645\u0635\u0641\u0648\u0641\u0629):\u0631\u0642\u0645 {\n    \u0625\u0631\u062c\u0627\u0639 \u0637\u0648\u0644 \u0627\u0644\u0634\u064a\u0621;\n}<\/code><\/pre>\n\n\n\n<p>\u0648\u0627\u0639\u062a\u0645\u0627\u062f\u064b\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u064a\u0627\u0642 \u0642\u062f \u064a\u0643\u0648\u0646 \u0630\u0644\u0643 \u0635\u062d\u064a\u062d\u064b\u0627\u060c \u0648\u0639\u0645\u0648\u0645\u064b\u0627 \u0646\u062d\u0646 \u0639\u0627\u0645\u0648\u0646 \u0628\u0639\u0636 \u0627\u0644\u0634\u064a\u0621 - \u0633\u062a\u0639\u0645\u0644 \u0645\u0639 \u0645\u0635\u0641\u0648\u0641\u0627\u062a \u0645\u0646 \u0623\u0646\u0648\u0627\u0639 \u0645\u062a\u0639\u062f\u062f\u0629\u060c \u0648\u0644\u0643\u0646 \u0645\u0627\u0630\u0627 \u0644\u0648 \u0644\u0645 \u0646\u0643\u0646 \u0646\u0639\u0631\u0641 \u062d\u0642\u064b\u0627 \u0645\u0627 \u0625\u0630\u0627 \u0643\u0627\u0646 \u0627\u0644\u0634\u064a\u0621 \u064a\u062c\u0628 \u0623\u0646 \u064a\u0643\u0648\u0646 \u0645\u0635\u0641\u0648\u0641\u064b\u0627 \u062f\u0627\u0626\u0645\u064b\u0627 - \u0631\u0628\u0645\u0627 \u064a\u0643\u0648\u0646 \u0627\u0644\u0634\u064a\u0621 \u0645\u0644\u0639\u0628 \u0643\u0631\u0629 \u0642\u062f\u0645 \u0623\u0648 \u0642\u0634\u0631\u0629 \u0645\u0648\u0632\u061f \u0641\u064a \u0647\u0630\u0647 \u0627\u0644\u062d\u0627\u0644\u0629\u060c \u0639\u0644\u064a\u0646\u0627 \u0641\u064a \u0647\u0630\u0647 \u0627\u0644\u062d\u0627\u0644\u0629 \u0623\u0646 \u0646\u062c\u0645\u0639 \u0627\u0644\u062e\u0635\u0627\u0626\u0635 \u0627\u0644\u0645\u0634\u062a\u0631\u0643\u0629 \u0644\u0630\u0644\u0643 \u0627\u0644\u0634\u064a\u0621 \u0641\u064a \u0628\u0646\u064a\u0629 \u064a\u0645\u0643\u0646\u0647\u0627 \u062a\u062d\u062f\u064a\u062f \u062e\u0635\u0627\u0626\u0635 \u0643\u0627\u0626\u0646 - \u0648\u0627\u062c\u0647\u0629:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\u0648\u0627\u062c\u0647\u0629 IThingWithLength {\n  \u0627\u0644\u0637\u0648\u0644: \u0631\u0642\u0645;\n}<\/code><\/pre>\n\n\n\n<p>\u064a\u0645\u0643\u0646\u0646\u0627 \u0627\u0633\u062a\u062e\u062f\u0627\u0645 <code>IThingWithLength<\/code> \u0627\u0644\u0648\u0627\u062c\u0647\u0629 \u0643\u0646\u0648\u0639 \u0645\u0646 <code>\u0627\u0644\u0634\u064a\u0621<\/code> \u0627\u0644\u0645\u0639\u0644\u0645\u0629:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\u062f\u0627\u0644\u0629 getLength(\u0627\u0644\u0634\u064a\u0621: IThingWithLength):\u0631\u0642\u0645 {\n    \u0625\u0631\u062c\u0627\u0639 \u0637\u0648\u0644 \u0627\u0644\u0634\u064a\u0621;\n}<\/code><\/pre>\n\n\n\n<p>\u0628\u0635\u0631\u0627\u062d\u0629 \u062a\u0627\u0645\u0629 \u0641\u064a \u0647\u0630\u0627 \u0627\u0644\u0645\u062b\u0627\u0644 \u0627\u0644\u0628\u0633\u064a\u0637\u060c \u0633\u064a\u0643\u0648\u0646 \u0627\u0644\u0623\u0645\u0631 \u0639\u0644\u0649 \u0645\u0627 \u064a\u0631\u0627\u0645 \u062a\u0645\u0627\u0645\u064b\u0627\u060c \u0648\u0644\u0643\u0646 \u0625\u0630\u0627 \u0623\u0631\u062f\u0646\u0627 \u0623\u0646 \u0646\u0628\u0642\u064a \u0647\u0630\u0627 \u0627\u0644\u0646\u0648\u0639 \u0639\u0627\u0645\u064b\u0627\u060c \u0648\u0644\u0627 \u0646\u0648\u0627\u062c\u0647 \u0627\u0644\u0645\u0634\u0643\u0644\u0629 \u0645\u0646 \u0627\u0644\u0645\u062b\u0627\u0644 \u0627\u0644\u0623\u0648\u0644 \u064a\u0645\u0643\u0646\u0646\u0627 \u0627\u0633\u062a\u062e\u062f\u0627\u0645 <strong>\u0627\u0644\u0642\u064a\u0648\u062f \u0627\u0644\u0639\u0627\u0645\u0629<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\u062f\u0627\u0644\u0629 getLength(\u0627\u0644\u0634\u064a\u0621: T):\u0631\u0642\u0645 {\n    \u0625\u0631\u062c\u0627\u0639 \u0637\u0648\u0644 \u0627\u0644\u0634\u064a\u0621;\n}<\/code><\/pre>\n\n\n\n<p>\u0648\u0627\u0633\u062a\u062e\u062f\u0627\u0645\u0647\u0627:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\u0648\u0627\u062c\u0647\u0629 IBananaPeel {\n  \u0627\u0644\u0633\u064f\u0645\u0643: \u0631\u0642\u0645;\n  \u0627\u0644\u0637\u0648\u0644: \u0631\u0642\u0645;\n}\n\nconst bananaPeel: IBananaPeel = {\u0627\u0644\u0633\u0645\u0627\u0643\u0629: 0.2\u060c \u0627\u0644\u0637\u0648\u0644: 3.14};\ngetLength(bananaPeel);<\/code><\/pre>\n\n\n\n<p>\u0627\u0633\u062a\u062e\u062f\u0627\u0645 <code>\u0627\u0644\u062a\u0645\u062f\u064a\u062f\u0627\u062a<\/code> \u062a\u0636\u0645\u0646 \u0623\u0646 <code>T<\/code> \u0639\u0644\u0649 \u062e\u0635\u0627\u0626\u0635 \u0645\u064f\u0639\u0631\u064e\u0651\u0641\u0629 \u0628\u0648\u0627\u0633\u0637\u0629 <code>IThingWithLength<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u0627\u0644\u0641\u0626\u0627\u062a \u0627\u0644\u0639\u0627\u0645\u0629<\/h2>\n\n\n\n<p>\u062d\u062a\u0649 \u0647\u0630\u0647 \u0627\u0644\u0646\u0642\u0637\u0629\u060c \u0643\u0646\u0627 \u0646\u0639\u0645\u0644 \u062d\u062a\u0649 \u0647\u0630\u0647 \u0627\u0644\u0644\u062d\u0638\u0629 \u0645\u0639 \u0627\u0644\u062f\u0648\u0627\u0644 \u0627\u0644\u0639\u0627\u0645\u0629\u060c \u0648\u0644\u0643\u0646\u0647\u0627 \u0644\u064a\u0633\u062a \u0627\u0644\u0645\u0643\u0627\u0646 \u0627\u0644\u0648\u062d\u064a\u062f \u0627\u0644\u0630\u064a \u062a\u062a\u0623\u0644\u0642 \u0641\u064a\u0647 \u0627\u0644\u062f\u0648\u0627\u0644 \u0627\u0644\u0639\u0627\u0645\u0629\u060c \u0644\u0646\u0631\u0649 \u0643\u064a\u0641 \u064a\u0645\u0643\u0646\u0646\u0627 \u062f\u0645\u062c\u0647\u0627 \u0641\u064a \u0627\u0644\u0641\u0635\u0648\u0644.<\/p>\n\n\n\n<p>\u0623\u0648\u0644\u0627\u064b \u062f\u0639\u0646\u0627 \u0646\u062d\u0627\u0648\u0644 \u062a\u062e\u0632\u064a\u0646 \u0645\u062c\u0645\u0648\u0639\u0629 \u0645\u0646 \u0627\u0644\u0645\u0648\u0632 \u0641\u064a \u0633\u0644\u0629 \u0627\u0644\u0645\u0648\u0632:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\u0635\u0646\u0641 \u0645\u0648\u0632\u0629 {\n  \u0645\u064f\u0646\u0634\u0626(\n    \u0627\u0644\u0637\u0648\u0644 \u0627\u0644\u0639\u0627\u0645: \u0631\u0642\u0645,\n    \u0644\u0648\u0646 \u0639\u0627\u0645: \u0633\u0644\u0633\u0644\u0629,\n    \u0625\u0634\u0639\u0627\u0639 \u0645\u0624\u064a\u0646 \u0639\u0627\u0645: \u0631\u0642\u0645\n  ) {}\n}\n\n\u0641\u0626\u0629 \u0633\u0644\u0629 \u0627\u0644\u0645\u0648\u0632 {\n  \u0645\u0648\u0632\u0627\u062a \u062e\u0627\u0635\u0629: \u0645\u0648\u0632\u0629[] = [];\n\n  \u0625\u0636\u0627\u0641\u0629(\u0645\u0648\u0632\u0629: \u0645\u0648\u0632\u0629): \u0628\u0627\u0637\u0644 { {\n    \u0647\u0630\u0627.bananas.push(\u0645\u0648\u0632\u0629);\n  }\n}\n\nconst bananaBasket = \u062c\u062f\u064a\u062f BananaBasket();\nbananaBasket.add(\u0645\u0648\u0632\u0629 \u062c\u062f\u064a\u062f\u0629(3.14\u060c '\u0623\u062d\u0645\u0631'\u060c 10e-7));<\/code><\/pre>\n\n\n\n<p>\u0627\u0644\u0622\u0646 \u062f\u0639\u0646\u0627 \u0646\u062d\u0627\u0648\u0644 \u0625\u0646\u0634\u0627\u0621 \u0633\u0644\u0629 \u0623\u063a\u0631\u0627\u0636 \u0639\u0627\u0645\u0629\u060c \u0644\u0623\u0634\u064a\u0627\u0621 \u0645\u062e\u062a\u0644\u0641\u0629 \u0645\u0646 \u0646\u0641\u0633 \u0627\u0644\u0646\u0648\u0639:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\u0641\u0626\u0629 \u0627\u0644\u0633\u0644\u0629 {\n  \u0623\u0634\u064a\u0627\u0621 \u062e\u0627\u0635\u0629: T[] = [];\n\n  \u0625\u0636\u0627\u0641\u0629 (\u0627\u0644\u0634\u064a\u0621: T): \u0628\u0627\u0637\u0644 {\n    this.stuff.push(thing);\n  }\n}\n\nconst bananaBasket = \u0633\u0644\u0629 \u062c\u062f\u064a\u062f\u0629&lt;\u0645\u0648\u0632();<\/code><\/pre>\n\n\n\n<p>\u0648\u0623\u062e\u064a\u0631\u064b\u0627\u060c \u0644\u0646\u0641\u062a\u0631\u0636 \u0623\u0646 \u0627\u0644\u0633\u0644\u0629 \u0639\u0628\u0627\u0631\u0629 \u0639\u0646 \u062d\u0627\u0648\u064a\u0629 \u0645\u0648\u0627\u062f \u0645\u0634\u0639\u0629 \u0648\u064a\u0645\u0643\u0646\u0646\u0627 \u062a\u062e\u0632\u064a\u0646 \u0627\u0644\u0645\u0627\u062f\u0629 \u0627\u0644\u062a\u064a \u062a\u062d\u062a\u0648\u064a \u0639\u0644\u0649 <code>\u0627\u0644\u0625\u0634\u0639\u0627\u0639 \u0627\u0644\u0645\u0624\u064a\u0646<\/code> \u0627\u0644\u0645\u0645\u062a\u0644\u0643\u0627\u062a:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\u0648\u0627\u062c\u0647\u0629 IR radioactive {\n  \u0627\u0644\u0625\u0634\u0639\u0627\u0639 \u0627\u0644\u0645\u0624\u064a\u0646: \u0627\u0644\u0639\u062f\u062f;\n}\n\n\u0641\u0626\u0629 RadactiveContainer {\n  \u0645\u0627\u062f\u0629 \u062e\u0627\u0635\u0629: T[] = [];\n\n  \u0625\u0636\u0627\u0641\u0629 (\u0627\u0644\u0634\u064a\u0621: T): \u0628\u0627\u0637\u0644 {\n    this.stuff.push(thing);\n  }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u0648\u0627\u062c\u0647\u0629 \u0639\u0627\u0645\u0629<\/h2>\n\n\n\n<p>\u0623\u062e\u064a\u0631\u064b\u0627 \u062f\u0639\u0648\u0646\u0627 \u0646\u062d\u0627\u0648\u0644 \u062c\u0645\u0639 \u0643\u0644 \u0645\u0639\u0631\u0641\u062a\u0646\u0627 \u0648\u0628\u0646\u0627\u0621 \u0625\u0645\u0628\u0631\u0627\u0637\u0648\u0631\u064a\u0629 \u0645\u0634\u0639\u0629 \u0623\u064a\u0636\u064b\u0627 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0627\u0644\u0648\u0627\u062c\u0647\u0627\u062a \u0627\u0644\u0639\u0627\u0645\u0629:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"typescript\" class=\"language-typescript\">\/\/ \u062a\u062d\u062f\u064a\u062f \u0627\u0644\u0633\u0645\u0627\u062a \u0627\u0644\u0645\u0634\u062a\u0631\u0643\u0629 \u0644\u0644\u062d\u0627\u0648\u064a\u0627\u062a\n\u0648\u0627\u062c\u0647\u0629 IRadioactive {\n  \u0627\u0644\u0625\u0634\u0639\u0627\u0639 \u0627\u0644\u0645\u0624\u064a\u0646: \u0627\u0644\u0639\u062f\u062f;\n}\n\n\n\/\/ \u062a\u0639\u0631\u064a\u0641 \u0634\u064a\u0621 \u0645\u0634\u0639\n\u0648\u0627\u062c\u0647\u0629 IBANANANA \u064a\u0645\u062a\u062f IRadioactive {\n  \u0627\u0644\u0637\u0648\u0644: \u0631\u0642\u0645;\n  \u0627\u0644\u0644\u0648\u0646: \u0633\u0644\u0633\u0644\u0629;\n}\n\n\/\/ \u062a\u0639\u0631\u064a\u0641 \u0634\u064a\u0621 \u063a\u064a\u0631 \u0645\u0634\u0639\n\u0648\u0627\u062c\u0647\u0629 IDog {\n  \u0627\u0644\u0648\u0632\u0646: \u0631\u0642\u0645;\n}\n\n\/\/ \u062a\u062d\u062f\u064a\u062f \u0648\u0627\u062c\u0647\u0629 \u0644\u0644\u062d\u0627\u0648\u064a\u0629 \u0627\u0644\u062a\u064a \u064a\u0645\u0643\u0646 \u0623\u0646 \u062a\u062d\u062a\u0648\u064a \u0641\u0642\u0637 \u0639\u0644\u0649 \u0627\u0644\u0623\u0634\u064a\u0627\u0621 \u0627\u0644\u0645\u0634\u0639\u0629\n\u0627\u0644\u0648\u0627\u062c\u0647\u0629 IRadioactiveContainer {\n  \u0625\u0636\u0627\u0641\u0629(\u0627\u0644\u0634\u064a\u0621: T): \u0628\u0627\u0637\u0644;\n  getRadioactiveactive(): \u0631\u0642\u0645;\n}\n\n\/\/ \u062a\u0639\u0631\u064a\u0641 \u0627\u0644\u0641\u0626\u0629 \u0627\u0644\u0645\u0646\u0641\u0630\u0629 \u0644\u0648\u0627\u062c\u0647\u0629 \u0627\u0644\u062d\u0627\u0648\u064a\u0629 \u0627\u0644\u0645\u0634\u0639\u0629\n\u0635\u0646\u0641 RadioactiveContainer \u064a\u0646\u0641\u0630 IRadioactiveContainer {\n  \u0623\u0634\u064a\u0627\u0621 \u062e\u0627\u0635\u0629 T[] = [];\n\n  \u0625\u0636\u0627\u0641\u0629(\u0627\u0644\u0634\u064a\u0621: T): \u0628\u0627\u0637\u0644 {\n    this.stuff.push(thing);\n  }\n\n  getRadioactiveness(): \u0631\u0642\u0645 {\n      \u0625\u0631\u062c\u0627\u0639 this.stuff.reduce((a, b) =&gt; a + b.ionizingRadiation, 0)\n  }\n}\n\n\/\/ \u062e\u0637\u0623! \u0627\u0644\u0646\u0648\u0639 'IDog' \u0644\u0627 \u064a\u0633\u062a\u0648\u0641\u064a \u0627\u0644\u0642\u064a\u062f 'IRadioactive'\n\/\/ \u0648\u0645\u0646 \u0627\u0644\u0648\u062d\u0634\u064a \u0646\u0648\u0639\u064b\u0627 \u0645\u0627 \u062a\u062e\u0632\u064a\u0646 \u0627\u0644\u0643\u0644\u0627\u0628 \u062f\u0627\u062e\u0644 \u0627\u0644\u062d\u0627\u0648\u064a\u0629 \u0627\u0644\u0645\u0634\u0639\u0629\nconst dogsContainer = \u062c\u062f\u064a\u062f RadioactiveContainer();\n\n\/\/ \u0643\u0644 \u0634\u064a\u0621 \u062c\u064a\u062f!\nconst radioactiveContainer = \u062c\u062f\u064a\u062f RadioactiveContainer();\n\n\/\/ \u062a\u0630\u0643\u0631 \u0623\u0646 \u062a\u0641\u0631\u0632 \u0646\u0641\u0627\u064a\u0627\u062a\u0643 \u0627\u0644\u0645\u0634\u0639\u0629 - \u0642\u0645 \u0628\u0625\u0646\u0634\u0627\u0621 \u062d\u0627\u0648\u064a\u0629 \u0645\u0646\u0641\u0635\u0644\u0629 \u0644\u0644\u0645\u0648\u0632 \u0641\u0642\u0637\nconst bananasContainer = \u062c\u062f\u064a\u062f RadioactiveContainer();<\/code><\/pre>\n\n\n\n<p>\u0647\u0630\u0627 \u0643\u0644 \u0634\u064a\u0621 \u064a\u0627 \u0631\u0641\u0627\u0642!<\/p>","protected":false},"excerpt":{"rendered":"<p>\u062a\u0648\u0641\u0631 \u0627\u0644\u0623\u062c\u0646\u0627\u0633 \u0627\u0644\u0639\u0627\u0645\u0629 \u0623\u062c\u0632\u0627\u0621 \u0645\u0646 \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u0628\u0631\u0645\u062c\u064a\u0629 \u0627\u0644\u0642\u0627\u0628\u0644\u0629 \u0644\u0625\u0639\u0627\u062f\u0629 \u0627\u0644\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0648\u0627\u0644\u062a\u064a \u062a\u0639\u0645\u0644 \u0645\u0639 \u0639\u062f\u062f \u0645\u0646 \u0627\u0644\u0623\u0646\u0648\u0627\u0639 \u0628\u062f\u0644\u0627\u064b \u0645\u0646 \u0646\u0648\u0639 \u0648\u0627\u062d\u062f. \u062a\u0648\u0641\u0631 \u0627\u0644\u0623\u062c\u0646\u0627\u0633 \u0627\u0644\u0639\u0627\u0645\u0629 \u0637\u0631\u064a\u0642\u0629 \u0644\u0644\u062a\u0639\u0627\u0645\u0644 \u0645\u0639 \u0627\u0644\u0646\u0648\u0639 \u0643\u0645\u062a\u063a\u064a\u0631 \u0648\u062a\u062d\u062f\u064a\u062f\u0647 \u0639\u0646\u062f \u0627\u0644\u0627\u0633\u062a\u062e\u062f\u0627\u0645\u060c \u0639\u0644\u0649 \u063a\u0631\u0627\u0631 \u0645\u0639\u0644\u0645\u0627\u062a \u0627\u0644\u062f\u0627\u0644\u0629.<\/p>","protected":false},"author":2,"featured_media":3249,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3248","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Generics in TypeScript - The Codest<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/ar\/\u0627\u0644\u0645\u062f\u0648\u0646\u0629\/\u0627\u0644\u0623\u062c\u0646\u0627\u0633-\u0641\u064a-\u0627\u0644\u0645\u062e\u0637\u0648\u0637\u0627\u062a-\u0627\u0644\u0645\u0637\u0628\u0648\u0639\u0629\/\" \/>\n<meta property=\"og:locale\" content=\"ar_AR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Generics in TypeScript\" \/>\n<meta property=\"og:description\" content=\"Generics provide reusable bits of code that work with a number of types instead of a single type. Generics provide a way to treat type as a variable and specify it on usage, similar to function parameters.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/ar\/\u0627\u0644\u0645\u062f\u0648\u0646\u0629\/\u0627\u0644\u0623\u062c\u0646\u0627\u0633-\u0641\u064a-\u0627\u0644\u0645\u062e\u0637\u0648\u0637\u0627\u062a-\u0627\u0644\u0645\u0637\u0628\u0648\u0639\u0629\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-13T08:52:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-24T11:39:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-75.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u062f\u0642\u0627\u0626\u0642\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"Generics in TypeScript\",\"datePublished\":\"2020-07-13T08:52:00+00:00\",\"dateModified\":\"2026-04-24T11:39:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/\"},\"wordCount\":516,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/cover-image-75.jpg\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"ar\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/\",\"name\":\"Generics in TypeScript - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/cover-image-75.jpg\",\"datePublished\":\"2020-07-13T08:52:00+00:00\",\"dateModified\":\"2026-04-24T11:39:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/#breadcrumb\"},\"inLanguage\":\"ar\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/cover-image-75.jpg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/cover-image-75.jpg\",\"width\":1200,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/generics-in-typescript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generics in TypeScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ar\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/ar\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u0627\u0644\u062c\u064a\u0646\u0627\u062a \u0627\u0644\u0639\u0627\u0645\u0629 \u0641\u064a TypeScript - The Codest","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thecodest.co\/ar\/\u0627\u0644\u0645\u062f\u0648\u0646\u0629\/\u0627\u0644\u0623\u062c\u0646\u0627\u0633-\u0641\u064a-\u0627\u0644\u0645\u062e\u0637\u0648\u0637\u0627\u062a-\u0627\u0644\u0645\u0637\u0628\u0648\u0639\u0629\/","og_locale":"ar_AR","og_type":"article","og_title":"Generics in TypeScript","og_description":"Generics provide reusable bits of code that work with a number of types instead of a single type. Generics provide a way to treat type as a variable and specify it on usage, similar to function parameters.","og_url":"https:\/\/thecodest.co\/ar\/\u0627\u0644\u0645\u062f\u0648\u0646\u0629\/\u0627\u0644\u0623\u062c\u0646\u0627\u0633-\u0641\u064a-\u0627\u0644\u0645\u062e\u0637\u0648\u0637\u0627\u062a-\u0627\u0644\u0645\u0637\u0628\u0648\u0639\u0629\/","og_site_name":"The Codest","article_published_time":"2020-07-13T08:52:00+00:00","article_modified_time":"2026-04-24T11:39:03+00:00","og_image":[{"width":1200,"height":600,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-75.jpg","type":"image\/jpeg"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"3 \u062f\u0642\u0627\u0626\u0642"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/generics-in-typescript\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/generics-in-typescript\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"Generics in TypeScript","datePublished":"2020-07-13T08:52:00+00:00","dateModified":"2026-04-24T11:39:03+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/generics-in-typescript\/"},"wordCount":516,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/generics-in-typescript\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-75.jpg","articleSection":["Software Development"],"inLanguage":"ar","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/generics-in-typescript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/generics-in-typescript\/","url":"https:\/\/thecodest.co\/blog\/generics-in-typescript\/","name":"\u0627\u0644\u062c\u064a\u0646\u0627\u062a \u0627\u0644\u0639\u0627\u0645\u0629 \u0641\u064a TypeScript - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/generics-in-typescript\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/generics-in-typescript\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-75.jpg","datePublished":"2020-07-13T08:52:00+00:00","dateModified":"2026-04-24T11:39:03+00:00","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/generics-in-typescript\/#breadcrumb"},"inLanguage":"ar","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/generics-in-typescript\/"]}]},{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/thecodest.co\/blog\/generics-in-typescript\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-75.jpg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-75.jpg","width":1200,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/generics-in-typescript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"Generics in TypeScript"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"The Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ar"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/ar\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/ar\/wp-json\/wp\/v2\/posts\/3248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/ar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/ar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/ar\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/ar\/wp-json\/wp\/v2\/comments?post=3248"}],"version-history":[{"count":9,"href":"https:\/\/thecodest.co\/ar\/wp-json\/wp\/v2\/posts\/3248\/revisions"}],"predecessor-version":[{"id":7822,"href":"https:\/\/thecodest.co\/ar\/wp-json\/wp\/v2\/posts\/3248\/revisions\/7822"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/ar\/wp-json\/wp\/v2\/media\/3249"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/ar\/wp-json\/wp\/v2\/media?parent=3248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/ar\/wp-json\/wp\/v2\/categories?post=3248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/ar\/wp-json\/wp\/v2\/tags?post=3248"}],"curies":[{"name":"\u062f\u0628\u0644\u064a\u0648 \u0628\u064a","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}