{"id":3656,"date":"2018-01-26T12:00:22","date_gmt":"2018-01-26T11:00:22","guid":{"rendered":"https:\/\/mastercaweb.u-strasbg.fr\/?p=3656"},"modified":"2018-01-26T12:00:22","modified_gmt":"2018-01-26T11:00:22","slug":"discovering-typescript","status":"publish","type":"post","link":"https:\/\/mastercaweb.unistra.fr\/en\/actualites\/un-categorized\/discovering-typescript\/","title":{"rendered":"Discovering TypeScript"},"content":{"rendered":"<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-11703 alignleft\" src=\"https:\/\/mastercaweb.u-strasbg.fr\/wp-content\/uploads\/2020\/05\/index.jpg\" alt=\"typescript\" width=\"299\" height=\"169\">TypeScript<\/strong> is not a new programming language, but rather a <b>typed superset of JavaScript<\/b> that transpiles to plain JavaScript. In other words, a valid JavaScript code is also a valid TypeScript code. Developed and maintained by Microsoft since 2012, it is designed to solve the shortcomings of JavaScript when developing large-scale applications.<\/p>\n<h2>Why should you write in TypeScript?<\/h2>\n<h3>It&nbsp;increases readability and maintainability<\/h3>\n<p>Typings are practically the best documentation you can have. You know how to use most of the functions by just looking at their type definition.<br \/>\nTypeScript will tell you about any errors it finds during compilation, for example, spelling mistakes and undeclared variables. It&#8217;s always better to notice errors during compilation, rather than during runtime. The full list of TypeScript compiler errors can be found on <a href=\"https:\/\/github.com\/Microsoft\/TypeScript\/blob\/v1.6.2\/src\/compiler\/diagnosticMessages.json\">TypeScript GitHub Repository<\/a>.<br \/>\nThis script also <b>enhances the functionalities provided by code editors<\/b> and IDE (Integrated Development Environment), such as auto-completion, definition prompting, jump-to-definition, and refactoring.<\/p>\n<h3>It&nbsp;is very flexible<\/h3>\n<p>It is very forgiving because even though its transpiler detects errors in your .ts files, it will still transpile them into .js&nbsp; files. Having said that, you can disable this feature by modifying the &#8220;tsconfig.json&#8221; file in your project folder.<br \/>\nIn addition, TypeScript is also very flexible. As mentioned before, it is a superset of JavaScript. As a result, you can directly rename your .js` files as .ts files. Types are optional. You can explicitly tell TypeScript the types of variables you are working with or let it infer types by itself.<br \/>\nTypeScript compiler also allows you to transpile your .ts files into .js files in different ECMAScript target versions, from &#8220;ES3&#8221; to &#8220;ESNext&#8221;, providing the <b>maximum amount of possible backward compatibility<\/b>.<\/p>\n<h3>It&nbsp;has an active community<\/h3>\n<p>Most of third-party JavaScript libraries provide typing definition files (.d.ts) written in <strong>TypeScript<\/strong>, so that you can make use of the auto-completion feature provided by code editors and IDEs. There are different frameworks that use TypeScript in their projects, such as Angular, NativeScript, Ionic.<br \/>\nTypeScript also embraces ES6 standards and provides some support for ES7 drafting standards.<\/p>\n<h2>What are the disadvantages of TypeScript?<\/h2>\n<p>Everything has two sides. For example, code written in TypeScript can seem to be too cumbersome since type annotations need to be used everywhere in order to get the most out of TypeScript.<br \/>\nTypeScript cannot be run on browsers directly and it <b>needs to be transpiled into JavaScript<\/b> first. Therefore, any modifications in your code written in this script can lead to another transpilation. However, you can set the compiler to watch your .ts files so that it can automatically transpile your .ts files into .js files.<\/p>\n<h2>How to use TypeScript?<\/h2>\n<p>To use this script, you first need <a href=\"https:\/\/nodejs.org\/en\/\">Node.js<\/a>&nbsp;to be installed on your computer.<br \/>\nThen, open your command line tool and type the following command to install it.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">npm install -g typescript\n<\/pre>\n<\/div>\n<p>Once it finished, you can run the following command to transpile your `.ts` files. In this example, we&#8217;re going to transpile our `hello_world.ts` file.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">tsc hello_world.ts\n<\/pre>\n<\/div>\n<h2><\/h2>\n<h2>Example<\/h2>\n<p>We&#8217;re going to write some TypeScript code to <b>discover the power of TypeScript<\/b>.<br \/>\nLet&#8217;s say we have the following data:<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #0000ff;\">let<\/span> lloyd = {\n    name: <span style=\"color: #a31515;\">'Lloyd'<\/span>,\n    homework: [90.0, 97.0, 75.0, 92.0],\n    quizzes: [88.0, 40.0, 94.0],\n    tests: [75.0, 90.0]\n};\n<span style=\"color: #0000ff;\">let<\/span> alice = {\n    name: <span style=\"color: #a31515;\">'Alice'<\/span>,\n    homework: [100.0, 92.0, 98.0, 100.0],\n    quizzes: [82.0, 83.0, 91.0],\n    tests: [89.0, 97.0]\n};\n<span style=\"color: #0000ff;\">let<\/span> tyler = {\n    name: <span style=\"color: #a31515;\">'Tyler'<\/span>,\n    homework: [0.0, 87.0, 75.0, 22.0],\n    quizzes: [0.0, 75.0, 78.0],\n    tests: [100.0, 100.0]\n};\n<span style=\"color: #0000ff;\">let<\/span> students = [lloyd, alice, tyler];\n<\/pre>\n<\/div>\n<p>We can write an interface to assure the data structure. We know that a student should have a name of type string, 3 arrays of scores (type number) for homework, quizzes and tests respectively. The possible interface can resemble the following:<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #0000ff;\">interface<\/span> Student {\n    name: <span style=\"color: #2b91af;\">string<\/span>;\n    homework: <span style=\"color: #2b91af;\">number<\/span>[];\n    quizzes: <span style=\"color: #2b91af;\">number<\/span>[];\n    tests: <span style=\"color: #2b91af;\">number<\/span>[];\n}\n<\/pre>\n<\/div>\n<p>Once we created the interface &#8220;Student&#8221;, we can assign the student objects with this type.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #0000ff;\">interface<\/span> Student {\n    name: <span style=\"color: #2b91af;\">string<\/span>;\n    homework: <span style=\"color: #2b91af;\">number<\/span>[];\n    quizzes: <span style=\"color: #2b91af;\">number<\/span>[];\n    tests: <span style=\"color: #2b91af;\">number<\/span>[];\n}\n<span style=\"color: #0000ff;\">let<\/span> lloyd: <span style=\"color: #2b91af;\">Student<\/span> = {\n    name: <span style=\"color: #a31515;\">'Lloyd'<\/span>,\n    homework: [90.0, 97.0, 75.0, 92.0],\n    quizzes: [88.0, 40.0, 94.0],\n    tests: [75.0, 90.0]\n};\n<span style=\"color: #0000ff;\">let<\/span> alice: <span style=\"color: #2b91af;\">Student<\/span> = {\n    name: <span style=\"color: #a31515;\">'Alice'<\/span>,\n    homework: [100.0, 92.0, 98.0, 100.0],\n    quizzes: [82.0, 83.0, 91.0],\n    tests: [89.0, 97.0]\n};\n<span style=\"color: #0000ff;\">let<\/span> tyler: <span style=\"color: #2b91af;\">Student<\/span> = {\n    name: <span style=\"color: #a31515;\">'Tyler'<\/span>,\n    homework: [0.0, 87.0, 75.0, 22.0],\n    quizzes: [0.0, 75.0, 78.0],\n    tests: [100.0, 100.0]\n};\n<span style=\"color: #0000ff;\">let<\/span> students: <span style=\"color: #2b91af;\">Student<\/span>[] = [lloyd, alice, tyler];\n<\/pre>\n<\/div>\n<p>Let&#8217;s say we create a new object called &#8220;mary&#8221; like this:<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #0000ff;\">let<\/span> mary: <span style=\"color: #2b91af;\">Student<\/span> = {\n    name: <span style=\"color: #a31515;\">'Mary'<\/span>\n};\n<\/pre>\n<\/div>\n<p>If you run the TypeScript compiler, an error message will appear.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">[ts] Type <span style=\"color: #a31515;\">'{ name: string; }'<\/span> is not assignable to type <span style=\"color: #a31515;\">'StudentResults'<\/span>. Property <span style=\"color: #a31515;\">'homework'<\/span> is missing in type <span style=\"color: #a31515;\">'{ name: string; }'<\/span>.\n<\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3663 size-full\" src=\"https:\/\/mastercaweb.u-strasbg.fr\/wp-content\/uploads\/2018\/01\/Capture-d\u2019\u00e9cran-2018-01-24-\u00e0-22.19.08.png\" alt=\"error1 typescript\" width=\"733\" height=\"100\"><br \/>\nThe reason for this is that &#8220;mary&#8221; is of type &#8220;Student&#8221;, and we defined that a &#8220;Student&#8221; should have a name of type &#8220;string&#8221;, homework, quizzes, tests of type &#8220;number array&#8221;. However, in our &#8220;mary&#8221; object, it only has a name, which resulted in an error.<br \/>\nNow, we can start writing the functions. First, let&#8217;s write a function to calculate the average score of a number array.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #0000ff;\">function<\/span> average(scores) {\n    <span style=\"color: #0000ff;\">return<\/span> scores.reduce((accumulator, currentValue) =&gt; accumulator + currentValue, 0) \/ score.length;\n}\n<\/pre>\n<\/div>\n<p>In this case, however, the code block isn&#8217;t type-safe because we can pass in anything to the &#8220;scores&#8221; parameter, which will cause the function to break. We can add types to ensure that only a number array is passed in as the &#8220;scores&#8221; parameter and the function should return a number as follows:<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #0000ff;\">function<\/span> average(scores: <span style=\"color: #2b91af;\">number<\/span>[]): <span style=\"color: #2b91af;\">number<\/span> {\n    <span style=\"color: #0000ff;\">return<\/span> scores.reduce((accumulator, currentValue) =&gt; accumulator + currentValue, 0) \/ score.length;\n}\n<\/pre>\n<\/div>\n<p>If we try to pass in &#8220;lloyd.name&#8221; as the &#8220;scores&#8221; parameter, it will result in an error again.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">[ts] Argument of type <span style=\"color: #a31515;\">'string'<\/span> is not assignable to parameter of type <span style=\"color: #a31515;\">'number[]'<\/span>.\n<\/pre>\n<\/div>\n<p>The complete code is available on my <a href=\"https:\/\/gitlab.com\/sk.cheung\/typescript-students-example\">GitLab Repository<\/a>.<\/p>\n<h2>Further Reading<\/h2>\n<p><a href=\"https:\/\/www.typescriptlang.org\/docs\/home.html\">Official TypeScript Documentation<\/a><br \/>\n<a href=\"http:\/\/definitelytyped.org\">DefintitelyTyped<\/a><\/p>\n<p>Article written by <a href=\"https:\/\/www.linkedin.com\/in\/siukeicheung\/\">Siu Kei CHEUNG<\/a>, CAWEB Master&#8217;s<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TypeScript is not a new programming language, but rather a typed superset of JavaScript that transpiles to plain JavaScript. In [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3659,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-3656","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Discovering TypeScript - Master CAWEB<\/title>\n<meta name=\"description\" content=\"What is TypeScript? TypeScript is not a new programming language, but rather a typed superset of JavaScript that transpiles to plain JavaScript.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Discovering TypeScript - Master CAWEB\" \/>\n<meta property=\"og:description\" content=\"What is TypeScript? TypeScript is not a new programming language, but rather a typed superset of JavaScript that transpiles to plain JavaScript.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/\" \/>\n<meta property=\"og:site_name\" content=\"Master CAWEB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/master.caweb\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-26T11:00:22+00:00\" \/>\n<meta name=\"author\" content=\"cawebinte1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mastercaweb\" \/>\n<meta name=\"twitter:site\" content=\"@mastercaweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"cawebinte1\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/discovering-typescript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/discovering-typescript\\\/\"},\"author\":{\"name\":\"cawebinte1\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#\\\/schema\\\/person\\\/431b92909694c397fc8112e99e2ef4aa\"},\"headline\":\"Discovering TypeScript\",\"datePublished\":\"2018-01-26T11:00:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/discovering-typescript\\\/\"},\"wordCount\":771,\"publisher\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/discovering-typescript\\\/#primaryimage\"},\"thumbnailUrl\":\"\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/discovering-typescript\\\/\",\"url\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/discovering-typescript\\\/\",\"name\":\"Discovering TypeScript - Master CAWEB\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/discovering-typescript\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/discovering-typescript\\\/#primaryimage\"},\"thumbnailUrl\":\"\",\"datePublished\":\"2018-01-26T11:00:22+00:00\",\"description\":\"What is TypeScript? TypeScript is not a new programming language, but rather a typed superset of JavaScript that transpiles to plain JavaScript.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/discovering-typescript\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/discovering-typescript\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/discovering-typescript\\\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/discovering-typescript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Discovering TypeScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#website\",\"url\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/\",\"name\":\"Master CAWEB\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#organization\",\"name\":\"Master CAWEB\",\"url\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/logo-caweb.webp\",\"contentUrl\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/logo-caweb.webp\",\"width\":351,\"height\":100,\"caption\":\"Master CAWEB\"},\"image\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/master.caweb\",\"https:\\\/\\\/x.com\\\/mastercaweb\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#\\\/schema\\\/person\\\/431b92909694c397fc8112e99e2ef4aa\",\"name\":\"cawebinte1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e4d7477db19aae8bc90c90565ae900f5ad6cb035ef4337cae03a3962f43935d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e4d7477db19aae8bc90c90565ae900f5ad6cb035ef4337cae03a3962f43935d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e4d7477db19aae8bc90c90565ae900f5ad6cb035ef4337cae03a3962f43935d?s=96&d=mm&r=g\",\"caption\":\"cawebinte1\"},\"sameAs\":[\"https:\\\/\\\/mastercaweb.unistra.fr\"],\"url\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/en\\\/actualites\\\/author\\\/cawebinte1\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Discovering TypeScript - Master CAWEB","description":"What is TypeScript? TypeScript is not a new programming language, but rather a typed superset of JavaScript that transpiles to plain JavaScript.","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:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/","og_locale":"en_US","og_type":"article","og_title":"Discovering TypeScript - Master CAWEB","og_description":"What is TypeScript? TypeScript is not a new programming language, but rather a typed superset of JavaScript that transpiles to plain JavaScript.","og_url":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/","og_site_name":"Master CAWEB","article_publisher":"https:\/\/www.facebook.com\/master.caweb","article_published_time":"2018-01-26T11:00:22+00:00","author":"cawebinte1","twitter_card":"summary_large_image","twitter_creator":"@mastercaweb","twitter_site":"@mastercaweb","twitter_misc":{"Written by":"cawebinte1","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/#article","isPartOf":{"@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/"},"author":{"name":"cawebinte1","@id":"https:\/\/mastercaweb.unistra.fr\/#\/schema\/person\/431b92909694c397fc8112e99e2ef4aa"},"headline":"Discovering TypeScript","datePublished":"2018-01-26T11:00:22+00:00","mainEntityOfPage":{"@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/"},"wordCount":771,"publisher":{"@id":"https:\/\/mastercaweb.unistra.fr\/#organization"},"image":{"@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/#primaryimage"},"thumbnailUrl":"","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/","url":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/","name":"Discovering TypeScript - Master CAWEB","isPartOf":{"@id":"https:\/\/mastercaweb.unistra.fr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/#primaryimage"},"image":{"@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/#primaryimage"},"thumbnailUrl":"","datePublished":"2018-01-26T11:00:22+00:00","description":"What is TypeScript? TypeScript is not a new programming language, but rather a typed superset of JavaScript that transpiles to plain JavaScript.","breadcrumb":{"@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/discovering-typescript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/mastercaweb.unistra.fr\/en\/"},{"@type":"ListItem","position":2,"name":"Discovering TypeScript"}]},{"@type":"WebSite","@id":"https:\/\/mastercaweb.unistra.fr\/#website","url":"https:\/\/mastercaweb.unistra.fr\/","name":"Master CAWEB","description":"","publisher":{"@id":"https:\/\/mastercaweb.unistra.fr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mastercaweb.unistra.fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/mastercaweb.unistra.fr\/#organization","name":"Master CAWEB","url":"https:\/\/mastercaweb.unistra.fr\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mastercaweb.unistra.fr\/#\/schema\/logo\/image\/","url":"https:\/\/mastercaweb.unistra.fr\/wp-content\/uploads\/2024\/03\/logo-caweb.webp","contentUrl":"https:\/\/mastercaweb.unistra.fr\/wp-content\/uploads\/2024\/03\/logo-caweb.webp","width":351,"height":100,"caption":"Master CAWEB"},"image":{"@id":"https:\/\/mastercaweb.unistra.fr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/master.caweb","https:\/\/x.com\/mastercaweb"]},{"@type":"Person","@id":"https:\/\/mastercaweb.unistra.fr\/#\/schema\/person\/431b92909694c397fc8112e99e2ef4aa","name":"cawebinte1","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5e4d7477db19aae8bc90c90565ae900f5ad6cb035ef4337cae03a3962f43935d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5e4d7477db19aae8bc90c90565ae900f5ad6cb035ef4337cae03a3962f43935d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5e4d7477db19aae8bc90c90565ae900f5ad6cb035ef4337cae03a3962f43935d?s=96&d=mm&r=g","caption":"cawebinte1"},"sameAs":["https:\/\/mastercaweb.unistra.fr"],"url":"https:\/\/mastercaweb.unistra.fr\/en\/actualites\/author\/cawebinte1\/"}]}},"_links":{"self":[{"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/posts\/3656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/comments?post=3656"}],"version-history":[{"count":0,"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/posts\/3656\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/media?parent=3656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/categories?post=3656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/tags?post=3656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}