{"id":3941,"date":"2020-09-24T08:52:00","date_gmt":"2020-09-24T08:52:00","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/why-you-should-probably-use-typescript\/"},"modified":"2026-04-27T09:49:47","modified_gmt":"2026-04-27T09:49:47","slug":"af-hverju-aettir-thu-liklega-ad-nota-typescript","status":"publish","type":"post","link":"https:\/\/thecodest.co\/is\/blog\/why-you-should-probably-use-typescript\/","title":{"rendered":"Af hverju \u00fe\u00fa \u00e6ttir (l\u00edklega) a\u00f0 nota TypeScript"},"content":{"rendered":"<p>N\u00faverandi sta\u00f0a af <a href=\"https:\/\/thecodest.co\/is\/dictionary\/typescript-developer\/\">Tegundaskjal<\/a> \u00dea\u00f0 kom ekki \u00far engu \u00fear sem \u00feessi t\u00e6kni getur raunverulega b\u00e6tt upplifun forritara okkar. Sk\u00fdrari k\u00f3\u00f0un eykur stj\u00f3rn og fyrirsj\u00e1anleika \u00ed <a href=\"https:\/\/thecodest.co\/is\/dictionary\/what-is-code-refactoring\/\">k\u00f3\u00f0i<\/a>.<br>\u00cd \u00feessari grein mun \u00e9g reyna a\u00f0 sannf\u00e6ra \u00feig um a\u00f0 nota TypeScript.<\/p>\n\n\n\n<p>*- <a href=\"https:\/\/thecodest.co\/is\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">G\u00f6gn<\/a> uppruni: <a href=\"https:\/\/2020.stateofjs.com\/en-US\/technologies\/javascript-flavors\/\">\u00c1stand JS 2020<\/a> og <a href=\"https:\/\/insights.stackoverflow.com\/survey\/2020#most-loved-dreaded-and-wanted\">Stack Overflow \u00fer\u00f3unara\u00f0ilak\u00f6nnun 2020<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Komdu a\u00f0 villum fyrr<\/h2>\n\n\n\n<p>Venjulega, \u00feegar \u00fe\u00fa ert a\u00f0 \u00fer\u00f3a forrit \u00ed <a href=\"https:\/\/thecodest.co\/is\/blog\/hire-javascript-developer\/\">JavaScript<\/a>, fl\u00e6\u00f0i \u00feitt g\u00e6ti<br>l\u00edtur svona \u00fat:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Ger\u00f0u breytingu,<\/li>\n\n\n\n<li>Far\u00f0u \u00ed forriti\u00f0 og sko\u00f0a\u00f0u breytta hlutann \/ keyri\u00f0 tengd pr\u00f3f.<\/li>\n\n\n\n<li>Komdu a\u00f0 \u00fev\u00ed hvort allt s\u00e9 \u00ed lagi.<\/li>\n<\/ol>\n\n\n\n<p>Me\u00f0 Typescript getur\u00f0u \u00ed raun gert breytinguna og ef einhver er <strong>Ger\u00f0argalli<\/strong> \u00cd k\u00f3\u00f0anum \u00fe\u00ednum munt \u00fe\u00fa vita \u00fea\u00f0 samstundis \u00fe\u00f6kk s\u00e9 villuskilabo\u00f0um \u00fe\u00fd\u00f0ilsins e\u00f0a raunt\u00edmavi\u00f0br\u00f6g\u00f0um IDE-sins.<br>Au\u00f0vita\u00f0 mun Typescript-\u00fe\u00fd\u00f0andinn ekki leysa \u00f6ll vandam\u00e1l n\u00e9 vara \u00feig vi\u00f0 \u00f6llum villum, en hj\u00e1lp hans getur veri\u00f0 \u00f3metanleg.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Betri setningafr\u00e6\u00f0ilokun \u00ed forritunarumhverfum<\/h2>\n\n\n\n<p>\u00dea\u00f0 er mj\u00f6g einfalt. Ef \u00fe\u00fa notar g\u00f3\u00f0ar IDE-umhverfi, eins og WebStorm e\u00f0a VSCode, munt \u00fe\u00fa f\u00e1<br>betri k\u00f3\u00f0auppfylling \u00ed TypeScript. Kannski hlj\u00f3mar \u00fea\u00f0 ekki eins og mikil b\u00f3t \u00e1 \u00fer\u00f3unarreynslunni, en a\u00f0 lokum skiptir hver einasta b\u00f3t m\u00e1li \u00fev\u00ed h\u00fan g\u00e6ti spara\u00f0 <a href=\"https:\/\/thecodest.co\/is\/blog\/why-us-companies-are-opting-for-polish-developers\/\">okkur<\/a> \u00dea\u00f0 sparar t\u00edma og kemur \u00ed veg fyrir leturvilla e\u00f0a mist\u00f6k. Einnig getum vi\u00f0 skilgreint tegundina e\u00f0a vi\u00f0m\u00f3ti\u00f0 einu sinni; \u00fear sem vi\u00f0 \u00feurfum ekki alltaf a\u00f0 muna uppbygginguna getum vi\u00f0 einbeitt okkur a\u00f0 ritun vi\u00f0skiptal\u00f3g\u00edkur.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/code.png\" alt=\"k\u00f3\u00f0i\" title=\"JS k\u00f3\u00f0i\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/js-code.png\" alt=\"JS k\u00f3\u00f0i\" title=\"k\u00f3\u00f0i\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">S\u00e1rsaukaminni endurskipulagning k\u00f3\u00f0a<\/h2>\n\n\n\n<p>\u00cdmynda\u00f0u \u00fe\u00e9r a\u00f0 \u00fe\u00fa \u00feurfir a\u00f0 endurskipuleggja k\u00f3\u00f0ann af einhverjum \u00e1st\u00e6\u00f0um, til d\u00e6mis ef \u00fe\u00fa hefur gengi\u00f0 til li\u00f0s vi\u00f0 a <a href=\"https:\/\/thecodest.co\/is\/dictionary\/why-do-projects-fail\/\">verkefni<\/a> og \u00fe\u00fa f\u00e6r\u00f0 verkefni\u00f0 a\u00f0 b\u00e6ta vi\u00f0 n\u00fdja eiginleika, en s\u00e1 eiginleiki er einhvernig tengdur vi\u00f0 erf\u00f0ak\u00f3\u00f0a.<br>Typescript getur gert \u00fea\u00f0 au\u00f0veldara og minna s\u00e1rt, \u00fev\u00ed \u00feegar \u00fe\u00fa gerir breytingu og er annar sta\u00f0ur \u00fear sem \u00fe\u00fa \u00fearft a\u00f0 gera a\u00f0ra breytingu, mun \u00fe\u00fd\u00f0andinn vara \u00feig vi\u00f0 \u00fev\u00ed.<\/p>\n\n\n\n<p>Til d\u00e6mis \u2013 \u00fea\u00f0 g\u00e6ti veri\u00f0 breytt a\u00f0ger\u00f0arskilt e\u00f0a kannski eftir breytinguna, a<br>Falli\u00f0 mun skila eitthva\u00f0 alveg \u00f6\u00f0ruv\u00edsi, svo skila\u00f0 ger\u00f0 mun einnig vera \u00f6\u00f0ruv\u00edsi.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Vertu \u00f6ruggari var\u00f0andi k\u00f3\u00f0agrunninn<\/h2>\n\n\n\n<p>JavaScript er veikbur\u00f0a og d\u00fdnam\u00edskt t\u00fdpu\u00f0, svo \u00feegar \u00fe\u00fa frumstillingar breytu me\u00f0 gildinu <code>leykja fyrirspurn = ''<\/code> S\u00ed\u00f0ar \u00ed k\u00f3\u00f0anum g\u00e6ti forritarinn af \u00f3vart gert eitthva\u00f0 \u00f3skynsamlegt, til d\u00e6mis <code>fyrirspurn = satt<\/code>, og \u00fea\u00f0 ver\u00f0ur gilt <a href=\"https:\/\/thecodest.co\/is\/blog\/hire-vue-js-developers\/\">JS<\/a> k\u00f3\u00f0a.<\/p>\n\n\n\n<p>\u00cd vel skrifu\u00f0um k\u00f3\u00f0a \u00e6tti ekki a\u00f0 \u00fathluta bool-gildi \u00ed breytu sem \u00e1\u00f0ur var streng. Venjulega stafar s\u00fa \u00fathlutun me\u00f0 tegundarbreytingu af mist\u00f6kum.<\/p>\n\n\n\n<p>\u00deegar vi\u00f0 notum TypeScript getum vi\u00f0 ekki breytt tegund breytunnar, svo ef vi\u00f0 gerum \u00fea\u00f0 <code>leykja fyrirspurn = ''<\/code> breytilegur, mun \u00fea\u00f0 vera <code>ke\u00f0ja<\/code> tegund og vi\u00f0 munum ekki geta breytt tegundinni fyrir slysni.<\/p>\n\n\n\n<p>Ef vi\u00f0 viljum leyfa breytu a\u00f0 vera af fleiri en einni tegund, gerum vi\u00f0 \u00fea\u00f0 alltaf sk\u00fdrt me\u00f0 union-ger\u00f0, til d\u00e6mis <code>string | number<\/code>.<\/p>\n\n\n\n<p>\u00deess vegna gerir Typescript k\u00f3\u00f0ann okkar fyrirsj\u00e1anlegri og sk\u00fdrari.<br>Einnig s\u00e9r TypeScript um sk\u00fdrleika \u00ed greiningu \u00e1 st\u00fdrifl\u00e6\u00f0i, og ef m\u00f6gulegt er a\u00f0 eitthva\u00f0 fari \u00farskei\u00f0is, mun \u00fea\u00f0 vara \u00feig vi\u00f0.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/code-sample.png\" alt=\"K\u00f3\u00f0ad\u00e6mi\" title=\"K\u00f3\u00f0ad\u00e6mi\"\/><\/figure>\n\n\n\n<p>H\u00e9r \u00ed d\u00e6mi \u00ed fyrsta <code>ef<\/code> blokk munum vi\u00f0 f\u00e1 villu:<\/p>\n\n\n\n<p><code>TS2339: Eignin 'battery' er ekki til sta\u00f0ar \u00e1 ger\u00f0inni 'ClothingProduct'<\/code> tvisvar sinnum, fyrir <code>rafhla\u00f0a<\/code>, og <code>gri\u00f0ingur<\/code> Eiginleikar.<\/p>\n\n\n\n<p>\u00cd \u00f6\u00f0rum blokk \u2013 <code>annars<\/code>, vi\u00f0 f\u00e1um \u00feessa villu fyrir <code>st\u00e6r\u00f0<\/code> eign. Au\u00f0vita\u00f0 er \u00feetta a\u00f0eins d\u00e6mi til a\u00f0 s\u00fdna \u00fe\u00e9r hvernig <a href=\"https:\/\/www.typescriptlang.org\/docs\/handbook\/2\/narrowing.html#discriminated-unions\">ford\u00f3mafullir sambandir<\/a> og <a href=\"https:\/\/www.typescriptlang.org\/docs\/handbook\/2\/narrowing.html#control-flow-analysis\">greining \u00e1 st\u00fdrifl\u00e6\u00f0i<\/a> Vinnum \u00ed TypeScript, svo vi\u00f0 erum ekki a\u00f0 gera neitt of fl\u00f3ki\u00f0 me\u00f0 \u00feennan k\u00f3\u00f0a.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Au\u00f0veld, stigvaxandi flutningur fr\u00e1 JavaScript<\/h2>\n\n\n\n<p>Gildur JavaScript-k\u00f3\u00f0i er jafnframt gildur TypeScript-k\u00f3\u00f0i, svo \u00fe\u00fa getur flutt k\u00f3\u00f0agrunninn \u00feinn skref fyrir skref. Venjulega er gott a\u00f0 nota strangt ham \u00ed TypeScript, en \u00ed \u00feessu tilfelli,<br>Vi\u00f0 ver\u00f0um a\u00f0 byrja \u00e1 <code>\"strangt\": falskt<\/code> \u00ed <code>tsconfig.json<\/code> og vi\u00f0 \u00e6ttum einnig a\u00f0 setja tv\u00e6r fleiri valkosti.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">\"allowJs\": true, \/\/ leyfir okkur a\u00f0 nota .js-skr\u00e1r og ger\u00f0ir ver\u00f0a ekki athuga\u00f0ar \u00ed \u00feeim\n\"skipLibCheck\": true \/\/ sleppir \u00fev\u00ed a\u00f0 athuga ger\u00f0ir \u00ed b\u00f3kas\u00f6fnum sem vi\u00f0 notum<\/code><\/pre>\n\n\n\n<p>Me\u00f0 \u00feessum valkostum getum vi\u00f0 flutt fr\u00e1 JS yfir \u00ed TS skref fyrir skref \u2013 skr\u00e1 fyrir skr\u00e1, einfaldlega breytt vi\u00f0b\u00f3tinni \u00far <code>.js(x)<\/code> til <code>.ts(x)<\/code> og b\u00e6ta vi\u00f0 ger\u00f0um \u00ed skr\u00e1rnar. Me\u00f0 \u00feessari n\u00e1lgun getum vi\u00f0 for\u00f0ast hundru\u00f0 e\u00f0a \u00fe\u00fasundir skelfilegra samsetningarmistaka.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Yfirlit<\/h2>\n\n\n\n<p>\u00c9g held a\u00f0 vi\u00f0 \u00e6ttum a\u00f0 nota <b>Tegundaskjal<\/b> svo oft sem <strong>m\u00f6gulegt<\/strong>, \u00fev\u00ed \u00fea\u00f0 er mj\u00f6g gagnlegt til lengri t\u00edma. \u00dea\u00f0 hj\u00e1lpar til vi\u00f0 a\u00f0 vi\u00f0halda verkefnum, eykur reynslu forritara og gerir k\u00f3\u00f0agrunninn okkar sk\u00fdrari og \u00e1rei\u00f0anlegri.<\/p>\n\n\n\n<p>Hins vegar, eins og alltaf, eru undantekningar \u2013 til d\u00e6mis fyrir einfalda lendingars\u00ed\u00f0u.<br>\u00dear sem JavaScript er eing\u00f6ngu nota\u00f0 til a\u00f0 skipta um class e\u00f0a \u00ed \u00f6\u00f0ru einf\u00f6ldu tilfelli, er TypeScript algj\u00f6rlega tilgangslaust.<br>Einnig ver\u00f0um vi\u00f0 a\u00f0 muna a\u00f0 til a\u00f0 n\u00fdta TypeScript til fulls ver\u00f0um vi\u00f0 a\u00f0 l\u00e6ra a\u00f0 nota \u00fea\u00f0 \u00e1 n\u00e6gu stigi, og \u00fea\u00f0 getur teki\u00f0 nokkurn t\u00edma. \u00c9g tel a\u00f0 \u00fea\u00f0 s\u00e9 enn mj\u00f6g ar\u00f0b\u00e6r fj\u00e1rfesting \u00ed t\u00edma \u00fe\u00ednum.<\/p>\n\n\n\n<p><strong>Lesa meira:<\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/\">Ruby 3.0. Ruby og minna \u00feekktar a\u00f0fer\u00f0ir til stj\u00f3rnunar pers\u00f3nuverndar<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/highest-quality-code-in-your-saas-project\/\">H\u00e6stu g\u00e6\u00f0ak\u00f3\u00f0i \u00ed SaaS-verkefni \u00fe\u00ednu. Af hverju \u00e6ttir \u00fe\u00fa sem (ekki t\u00e6knilegur) stofnandi a\u00f0 hafa \u00e1huga \u00e1 \u00fev\u00ed?<\/a><\/p>\n\n\n\n<p><em>Titilmyndin er fengin af vefs\u00ed\u00f0unni Know Your Meme.<\/em><\/p>","protected":false},"excerpt":{"rendered":"<p>Allir sem nota JavaScript vistkerfi\u00f0 eru \u00ed dag me\u00f0vita\u00f0ir um Typescript. Typescript er ein af \u00e1sts\u00e6lustu t\u00e6knunum* og notkun hennar eykst st\u00f6\u00f0ugt (notkunarhlutdeild j\u00f3kst \u00far 52% \u00e1ri\u00f0 2018 \u00ed 78% \u00e1ri\u00f0 2020)*.<\/p>","protected":false},"author":2,"featured_media":3942,"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-3941","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>Why you should (probably) use 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\/is\/blogg\/af-hverju-aettir-thu-liklega-ad-nota-typescript\/\" \/>\n<meta property=\"og:locale\" content=\"is_IS\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Why you should (probably) use Typescript\" \/>\n<meta property=\"og:description\" content=\"Everyone who use JavaScript ecosystem is nowadays aware of Typescript. Typescript is one of the most beloved technologies* and its usage is constantly increasing (usage share increased from 52% in 2018 to 78% in 2020)*.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/is\/blogg\/af-hverju-aettir-thu-liklega-ad-nota-typescript\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-24T08:52:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-27T09:49:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/typescript.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"Why you should (probably) use Typescript\",\"datePublished\":\"2020-09-24T08:52:00+00:00\",\"dateModified\":\"2026-04-27T09:49:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/\"},\"wordCount\":787,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/typescript.png\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"is\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/\",\"name\":\"Why you should (probably) use Typescript - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/typescript.png\",\"datePublished\":\"2020-09-24T08:52:00+00:00\",\"dateModified\":\"2026-04-27T09:49:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/#breadcrumb\"},\"inLanguage\":\"is\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"is\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/typescript.png\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/typescript.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-you-should-probably-use-typescript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Why you should (probably) use 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\":\"is\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"is\",\"@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\":\"is\",\"@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\\\/is\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Af hverju \u00fe\u00fa \u00e6ttir (l\u00edklega) a\u00f0 nota 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\/is\/blogg\/af-hverju-aettir-thu-liklega-ad-nota-typescript\/","og_locale":"is_IS","og_type":"article","og_title":"Why you should (probably) use Typescript","og_description":"Everyone who use JavaScript ecosystem is nowadays aware of Typescript. Typescript is one of the most beloved technologies* and its usage is constantly increasing (usage share increased from 52% in 2018 to 78% in 2020)*.","og_url":"https:\/\/thecodest.co\/is\/blogg\/af-hverju-aettir-thu-liklega-ad-nota-typescript\/","og_site_name":"The Codest","article_published_time":"2020-09-24T08:52:00+00:00","article_modified_time":"2026-04-27T09:49:47+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/typescript.png","type":"image\/png"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"Why you should (probably) use Typescript","datePublished":"2020-09-24T08:52:00+00:00","dateModified":"2026-04-27T09:49:47+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/"},"wordCount":787,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/typescript.png","articleSection":["Software Development"],"inLanguage":"is","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/","url":"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/","name":"Af hverju \u00fe\u00fa \u00e6ttir (l\u00edklega) a\u00f0 nota TypeScript - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/typescript.png","datePublished":"2020-09-24T08:52:00+00:00","dateModified":"2026-04-27T09:49:47+00:00","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/#breadcrumb"},"inLanguage":"is","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/"]}]},{"@type":"ImageObject","inLanguage":"is","@id":"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/typescript.png","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/typescript.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"Why you should (probably) use 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":"is"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"is","@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":"is","@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\/is\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/posts\/3941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/comments?post=3941"}],"version-history":[{"count":7,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/posts\/3941\/revisions"}],"predecessor-version":[{"id":8171,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/posts\/3941\/revisions\/8171"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/media\/3942"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/media?parent=3941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/categories?post=3941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/tags?post=3941"}],"curies":[{"name":"vp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}