{"id":57961,"date":"2021-11-10T21:01:43","date_gmt":"2021-11-10T13:01:43","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=57961"},"modified":"2021-11-03T19:35:20","modified_gmt":"2021-11-03T11:35:20","slug":"typescript-and-javascript","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/","title":{"rendered":"TypeScript and How is it Different from JavaScript"},"content":{"rendered":"<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.typescriptlang.org\/\">TypeScript<\/a> is a statically typed <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/bizarre-insane-programming-languages\/\" rel=\"noopener\">programming language<\/a> that bills itself as an extension of <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/tag\/javascript-libraries\/\" rel=\"noopener\">JavaScript<\/a>. Typescript code is compiled into JavaScript code that can be run both on the client side (browser) and on the server side (nodejs). The quality of the generated code is comparable to the code written by a professional developer with extensive experience.<\/p>\n<p>The <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.typescriptlang.org\/play\">TypeScript multiplatform compiler<\/a> is fast compilation and is distributed under the Apache license and contributors from all over the world, leading to the tradition of releasing a new version every two months.<\/p>\n<p>Despite this periodicity, the versions remain compatible for a long time, and after a long time, the obsolete behavior remains available when special compiler flags are activated.<\/p>\n<p>Therefore, you should not be afraid that the project would be deprived of new language features due to TypeScript versioning differences.<\/p>\n<p>Well, many compiler developers means that with each new version, the compiler receives updates in all areas, be it syntax constructions or optimizing the compilation and assembly speed of the project.<\/p>\n<div class=\"ref-block ref-block--post\" id=\"ref-post-1\">\n\t\t\t\t\t<a href=\"https:\/\/www.hongkiat.com\/blog\/angularjs-tutorials-screencast\/\" class=\"ref-block__link\" title=\"Read More: 10 Best Tutorials to Learn Angular\" rel=\"bookmark\"><span class=\"screen-reader-text\">10 Best Tutorials to Learn Angular<\/span><\/a>\n<div class=\"ref-block__thumbnail img-thumb img-thumb--jumbo\" data-img='{ \"src\" : \"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/250x160\/angularjs-tutorials-screencast.jpg\" }'>\n\t\t\t\t\t\t\t<noscript>\n<style>.no-js #ref-block-post-23139 .ref-block__thumbnail { background-image: url(\"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/250x160\/angularjs-tutorials-screencast.jpg\"); }<\/style>\n<\/noscript>\n\t\t\t\t\t\t<\/div>\n<div class=\"ref-block__summary\">\n<h4 class=\"ref-title\">10 Best Tutorials to Learn Angular<\/h4>\n<p class=\"ref-description\">\n\t\t\t\t\t\tAngular is an awesome JavaScript framework that can be used to create powerful and dynamic web apps. It...\t\t\t\t\t\t<span>Read more<\/span><\/p>\n<\/div>\n<\/div>\n<h2>Advantages of Typescript<\/h2>\n<h3>Strong static typing<\/h3>\n<p>JavaScript is not strongly typed. TypeScript comes with an optional static typing and type inference system over TLS (TypeScript Language Service).<\/p>\n<p>The type of variable declared without a type can be determined by TLS based on its value.<\/p>\n<h3>Improved OOP<\/h3>\n<p>Both JS and TS have support for object-oriented programming: classes, objects, inheritance. However, TypeScript has taken a step further and takes advantage of more of the OPP capabilities.<\/p>\n<p>There are various capabilities, for example:<\/p>\n<ul>\n<li>Defining fields in the constructor<\/li>\n<li>Type conversion<\/li>\n<li>Abstract classes<\/li>\n<li>Generalization.<\/li>\n<\/ul>\n<h3>Compilation<\/h3>\n<p>JavaScript is an interpreted language. Therefore, it needs to be run to check that everything is working well. This means that you are coding without the ability to detect errors. Hence, you have to spend hours trying to find errors in your code.<\/p>\n<p>The TypeScript transporter provides error-checking functionality. TypeScript will compile the code and generate compilation errors if it encounters any syntax errors. This helps to highlight errors before running the script.<\/p>\n<h2>TypeScript\u2019s components<\/h2>\n<p>TypeScript is based on the following three components:<\/p>\n<ol>\n<li><strong>TypeScript Compiler<\/strong> \u2013 (TSC) converts instructions written in TypeScript to its JavaScript equivalent.<\/li>\n<li>The language composed of type annotations, syntax and keywords.<\/li>\n<li><strong>Language Service<\/strong>. This component layer sits on top of the main TypeScript compiler and provides the functionality you need to work in IDEs and text editors: statement completions, code formatting and outlining, syntax highlighting, and more. The language service also provides code refactoring: variable renaming, debugging, and incremental compilation.<\/li>\n<\/ol>\n<h2>Basics of TypeScript<\/h2>\n<p>Well, let's take a look at the basic elements of TypeScript and explore them to understand how to work with this programming language.<\/p>\n<h3>Variables and constants<\/h3>\n<p>You can use the var keyword to define variables, just like in JavaScript. Another way to define a variable is to use the <code>let<\/code> keyword, added to JavaScript in ES 2015.<\/p>\n<p>Using <code>let<\/code> is preferred because it avoids some problems associated with declaring variables. By using <code>var<\/code>, we can define a variable with the same name twice or more.<\/p>\n<pre>\r\nvar x = \"hi\" \r\nconsole.log(x);\r\nvar x = \"do\";\r\nconsole.log(x);\r\n<\/pre>\n<p>So, if the program is large, then we cannot track the fact that such a variable has already been declared, which is a source of potential errors. A similar problem can be solved with <code>let<\/code>, if the variable has already been declared, an error will be indicated.<\/p>\n<pre>\r\nlet x = \"hi\";\r\nconsole.log(x);\r\nlet x = \"do\"; \/\/ an error, variable x is already declared\r\nconsole.log(x);\r\n<\/pre>\n<p>In addition to variables, TypeScript has constants, you can set a value for them only once. The const keyword is used to define constants:<\/p>\n<pre>const y = 1;\r\ny = 2; \/\/ an error, you cannot change the value of the constant y\r\n<\/pre>\n<h3>Access modifiers<\/h3>\n<p>Access modifiers allow you to hide the state of an object from external access and control access to that state. There are three modifiers in TypeScript: public, protected, and private.<\/p>\n<p>If you do not assign any modifier, properties and functions are automatically determined to use the public modifier.<\/p>\n<p>private. Elements with this modifier are available only from the class in which they are defined.<\/p>\n<pre>\r\nclass Person { \r\n\tprivate name: string;\r\n\tconstructor(name: string) {\r\n\t\tthis.name= name;\r\n\t}\r\n\tpublic print(): void {\r\n\t\tconsole.log(`Name: ${this.name}`);\/\/ cannot be accessed, cause name is private\r\n\t}\r\n}\r\nlet bob = new Person(\"Bob\");\r\nbob.print();\r\n<\/pre>\n<p>The name property uses the private modifier, so we cannot use it outside the class, for example console.log (bob.name).<\/p>\n<p>protected. Elements with this modifier are available from the class in which they are defined and from subclasses \/ derived classes.<\/p>\n<h3>Arrays<\/h3>\n<p>Arrays are defined using the <code>[]<\/code> expression and are strongly typed. That is, if initially the array contains strings, then in the future it will only be able to work with strings.<\/p>\n<p><strong>ReadonlyArray<\/strong><\/p>\n<p>TypeScript also allows you to define arrays whose elements cannot be modified. For this, the <code>ReadonlyArray&lt;&gt;<\/code> type is used, for which the type of array elements is indicated in angle brackets.<\/p>\n<p>Unlike the Array type, for the <code>ReadonlyArray<\/code> type, we cannot accept a constructor. Instead, you need to pass the values as a regular array:<\/p>\n<pre>const colors: ReadonlyArray = [\"Green\", \"Red\"];<\/pre>\n<h3>Tuples<\/h3>\n<p>With the tuple type, you can declare an array of known length with known types as its elements. When retrieving an element from such an array, TypeScript will automatically determine its type based on the description.<\/p>\n<p>Unlike arrays, tuples can store values of different types.<\/p>\n<p>The array syntax is used to define a tuple:<\/p>\n<pre>let user: [string, number]; \/\/ consists of a string and a number<\/pre>\n<h3>Functions<\/h3>\n<p>TypeScript also defines a function using the function keyword, but it adds additional functionality for working with functions.<\/p>\n<p>In particular, we can now determine the type of the passed parameters and the type of the return value.<\/p>\n<pre>\r\nfunction add(x: number, y: number){\r\nlet addition = x + y;\r\nconsole.log(addition);\r\n }\r\n<\/pre>\n<h3>Objects<\/h3>\n<p>An object is an instance that contains many key-value pairs. The values can be scalar values or functions, or even an array of other objects.<\/p>\n<p>However, despite the fact that this is actually the same object that we could use in JavaScript, due to the strict typing of TS, we have limitations in this case. In particular, if we have the following code:<\/p>\n<pre>\r\nlet cat = { name: \"Bob\", age: 4};\r\ncat = { name: \"Alex\" };  \/\/ Error\r\n<\/pre>\n<p>TypeScript allows you to make properties optional. To do this, after the name of the property, you need to put \u201c?\u201d.<\/p>\n<pre>let cat : { name?: string; age: number }; \/\/ The name property is optional<\/pre>\n<h2>Conclusion<\/h2>\n<p>If you haven't tried TypeScript yet, it is highly recommended that you give it a try. For JavaScript developers, it will provide many features that will simplify the work: you will save a lot of time and significantly reduce errors.<\/p>","protected":false},"excerpt":{"rendered":"<p>TypeScript is a statically typed programming language that bills itself as an extension of JavaScript. Typescript code is compiled into JavaScript code that can be run both on the client side (browser) and on the server side (nodejs). The quality of the generated code is comparable to the code written by a professional developer with&hellip;<\/p>\n","protected":false},"author":387,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[3392],"tags":[4117,511],"topic":[],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>TypeScript and How is it Different from JavaScript - Hongkiat<\/title>\n<meta name=\"description\" content=\"TypeScript is a statically typed programming language that bills itself as an extension of JavaScript. Typescript code is compiled into JavaScript code\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TypeScript and How is it Different from JavaScript\" \/>\n<meta property=\"og:description\" content=\"TypeScript is a statically typed programming language that bills itself as an extension of JavaScript. Typescript code is compiled into JavaScript code\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-10T13:01:43+00:00\" \/>\n<meta name=\"author\" content=\"Nikita\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nikita\" \/>\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:\\\/\\\/www.hongkiat.com\\\/blog\\\/typescript-and-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/typescript-and-javascript\\\/\"},\"author\":{\"name\":\"Nikita\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/84c1af9448851225e4e9f9e466a520fb\"},\"headline\":\"TypeScript and How is it Different from JavaScript\",\"datePublished\":\"2021-11-10T13:01:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/typescript-and-javascript\\\/\"},\"wordCount\":1000,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"keywords\":[\"Javascripts\",\"Web Developers\"],\"articleSection\":[\"Coding\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/typescript-and-javascript\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/typescript-and-javascript\\\/\",\"name\":\"TypeScript and How is it Different from JavaScript - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"datePublished\":\"2021-11-10T13:01:43+00:00\",\"description\":\"TypeScript is a statically typed programming language that bills itself as an extension of JavaScript. Typescript code is compiled into JavaScript code\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/typescript-and-javascript\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/typescript-and-javascript\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/typescript-and-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TypeScript and How is it Different from JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/84c1af9448851225e4e9f9e466a520fb\",\"name\":\"Nikita\",\"description\":\"Nikita is an enthusiastic writer who is fond of IT programming and technology. In his free time from writing, he reads books and, most likely, drinks coffee at this time. But he also does not forget about performing physical exercises, which give him a massive boost of energy and pleasure.\",\"sameAs\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/nikita\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"TypeScript and How is it Different from JavaScript - Hongkiat","description":"TypeScript is a statically typed programming language that bills itself as an extension of JavaScript. Typescript code is compiled into JavaScript code","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:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/","og_locale":"en_US","og_type":"article","og_title":"TypeScript and How is it Different from JavaScript","og_description":"TypeScript is a statically typed programming language that bills itself as an extension of JavaScript. Typescript code is compiled into JavaScript code","og_url":"https:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2021-11-10T13:01:43+00:00","author":"Nikita","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Nikita","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/"},"author":{"name":"Nikita","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/84c1af9448851225e4e9f9e466a520fb"},"headline":"TypeScript and How is it Different from JavaScript","datePublished":"2021-11-10T13:01:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/"},"wordCount":1000,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"keywords":["Javascripts","Web Developers"],"articleSection":["Coding"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/","url":"https:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/","name":"TypeScript and How is it Different from JavaScript - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"datePublished":"2021-11-10T13:01:43+00:00","description":"TypeScript is a statically typed programming language that bills itself as an extension of JavaScript. Typescript code is compiled into JavaScript code","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/typescript-and-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"TypeScript and How is it Different from JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/84c1af9448851225e4e9f9e466a520fb","name":"Nikita","description":"Nikita is an enthusiastic writer who is fond of IT programming and technology. In his free time from writing, he reads books and, most likely, drinks coffee at this time. But he also does not forget about performing physical exercises, which give him a massive boost of energy and pleasure.","sameAs":["https:\/\/www.hongkiat.com\/blog\/"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/nikita\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-f4R","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/57961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/387"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=57961"}],"version-history":[{"count":1,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/57961\/revisions"}],"predecessor-version":[{"id":57962,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/57961\/revisions\/57962"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=57961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=57961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=57961"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=57961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}