

{"id":112902,"date":"2023-04-14T09:00:10","date_gmt":"2023-04-14T03:30:10","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=112902"},"modified":"2023-04-14T11:01:37","modified_gmt":"2023-04-14T05:31:37","slug":"objects-in-typescript","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/","title":{"rendered":"Objects in TypeScript"},"content":{"rendered":"<p>One of the core concepts of TypeScript is objects, which represent data structures in a program.<\/p>\n<p>In TypeScript, objects are instances of a class, which defines their properties and methods. Defining a class is the first step in creating an object. Here is an example of a class definition:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class DataFlair_Person {\r\n firstName: string;\r\n lastName: string;\r\n\r\n\r\n constructor(firstName: string, lastName: string) {\r\n   this.firstName = firstName;\r\n   this.lastName = lastName;\r\n }\r\n\r\n\r\n getFullName(): string {\r\n   return `${this.firstName} ${this.lastName}`;\r\n }\r\n}\r\n<\/pre>\n<p>In this example, we define a class called DataFlair_Person with two properties, firstName and lastName, and one method, getFullName(). The constructor function takes two arguments, firstName and lastName, and initializes the object&#8217;s properties.<\/p>\n<p>To create an object of this class, we use the new keyword:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const person = new DataFlair_Person('John', 'Doe');\r\n<\/pre>\n<p>This creates a new DataFlair_Person class object with the firstName property set to &#8216;John&#8217; and the lastName property set to &#8216;Doe.&#8217;<\/p>\n<p>Once you have created an object, you can access its properties and methods using the dot notation:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">console.log(person.firstName); \/\/ 'John'\r\nconsole.log(person.lastName); \/\/ 'Doe'\r\nconsole.log(person.getFullName()); \/\/ 'John Doe'\r\n<\/pre>\n<p>In TypeScript, objects can also be defined using interfaces. An interface is a contract that defines the shape of an object, but it does not provide an implementation. Here is an example of an interface definition:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface DataFlair_Animal {\r\n name: string;\r\n species: string;\r\n makeSound(): void;\r\n}\r\n<\/pre>\n<p>In this example, we define a DataFlair_Animal interface with three properties: name, species, and makeSound(). The makeSound() method does not return anything (void).<\/p>\n<p>To create an object that implements this interface, we define an object literal that has the same properties and methods:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const dog: DataFlair_Animal = {\r\n name: 'Rufus',\r\n species: 'Dog',\r\n makeSound() {\r\n   console.log('Woof!');\r\n },\r\n};\r\n<\/pre>\n<p>This creates a dog object with the name property set to &#8216;Rufus.&#8217; The species property set to &#8216;Dog,&#8217; and the makeSound() method logs &#8216;Woof!&#8217; to the console.<\/p>\n<p>To work with objects in TypeScript, it&#8217;s important to understand some key concepts related to objects, including inheritance, encapsulation, and polymorphism.<\/p>\n<h3>Inheritance in TypeScript<\/h3>\n<p>Inheritance is the process by which one class can inherit the properties and methods of another class. In TypeScript, inheritance is achieved using the extends keyword. This is an example of a class hierarchy:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class DataFlair_Animal {\r\n name: string;\r\n\r\n\r\n constructor(name: string) {\r\n   this.name = name;\r\n }\r\n\r\n makeSound(): void {\r\n   console.log('Generic animal sound');\r\n }\r\n}\r\n\r\nclass Dog extends DataFlair_Animal {\r\n makeSound(): void {\r\n   console.log('Woof!');\r\n }\r\n}\r\n<\/pre>\n<p>In this example, we define a base class called DataFlair_Animal with a name property and a makeSound() method. We then define a subclass called Dog that extends the DataFlair_Animal class and overrides the makeSound() method to log &#8216;Woof!&#8217; to the console.<\/p>\n<h3>Encapsulation in TypeScript<\/h3>\n<p>Encapsulation is the process of hiding data from outside access to ensure data integrity and security. In TypeScript, encapsulation is achieved by private or protected properties and methods. Here is an example of a class with private and protected properties:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class DataFlair_BankAccount {\r\n private accountNumber: string;\r\n protected balance: number;\r\n\r\n constructor(accountNumber: string, balance: number) {\r\n   this.accountNumber = accountNumber;\r\n   this.balance = balance;\r\n }\r\n\r\n deposit(amount: number): void {\r\n   this.balance += amount;\r\n }\r\n\r\n withdraw(amount: number): void {\r\n   if (this.balance &gt;= amount) {\r\n     this.balance -= amount;\r\n   } else {\r\n     console.log('Insufficient funds');\r\n   }\r\n }\r\n}\r\n\r\nclass SavingsAccount extends DataFlair_BankAccount {\r\n private interestRate: number;\r\n\r\n constructor(accountNumber: string, balance: number, interestRate: number) {\r\n   super(accountNumber, balance);\r\n   this.interestRate = interestRate;\r\n }\r\n\r\n\r\n addInterest(): void {\r\n   const interest = this.balance * (this.interestRate \/ 100);\r\n   this.deposit(interest);\r\n }\r\n}\r\n<\/pre>\n<p>In this example, we define a DataFlair_BankAccount class with a private accountNumber property and a protected balance property. We also define a deposit() method that adds funds to the account and a withdraw() method that subtracts funds from the account. We then define a SavingsAccount class that extends the BankAccount class. It adds a private interestRate property and an addInterest() method that calculates and adds interest to the account.<\/p>\n<h3>Polymorphism in TypeScript<\/h3>\n<p>Polymorphism is the process by which one object can take on many forms. In TypeScript, polymorphism is achieved through method overriding and method overloading. Method overriding occurs when a subclass provides a specific implementation of a method already provided by its parent class. When a class has numerous methods with the same name but different parameters, this is known as method overloading. Here is an illustration of a method override:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class DataFlair_Shape {\r\n draw(): void {\r\n   console.log('Drawing a generic shape');\r\n }\r\n}\r\n\r\nclass Circle extends DataFlair_Shape {\r\n draw(): void {\r\n   console.log('Drawing a circle');\r\n }\r\n}\r\n<\/pre>\n<p>In this example, we define a DataFlair_Shape class with a draw() method that logs &#8216;Drawing a generic shape&#8217; to the console. We then define a Circle class that extends the DataFlair_Shape class and overrides the draw() method to log &#8216;Drawing a circle&#8217; to the console.<\/p>\n<h3>Object Template<\/h3>\n<p>Templates in objects, also known as generic types, are a feature in TypeScript that allows a class or function to work with different types of data without specifying the type at compile-time.<\/p>\n<p>Templates are defined using angle brackets (&lt;&gt;) and can be used to declare a type parameter for a class or function. The type parameter can then be used within the class or function to create a generic implementation that works with any type that meets certain requirements.<\/p>\n<p>Here is an example of using templates in TypeScript:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class DataFlair_Stack&lt;T&gt; {\r\n private items: T[] = [];\r\n\r\n\r\n push(item: T) {\r\n   this.items.push(item);\r\n }\r\n\r\n\r\n pop(): T | undefined {\r\n   return this.items.pop();\r\n }\r\n}\r\n\r\n\r\nconst numberStack = new DataFlair_Stack&lt;number&gt;();\r\nnumberStack.push(1);\r\nnumberStack.push(2);\r\nconsole.log(numberStack.pop());\r\n\r\n\r\nconst stringStack = new DataFlair_Stack&lt;string&gt;();\r\nstringStack.push('Hello');\r\nstringStack.push('World');\r\nconsole.log(stringStack.pop());\r\n<\/pre>\n<p><strong>Output<\/strong> &#8211;<\/p>\n<div class=\"code-output\">2<br \/>\nWorld<\/div>\n<p>In this example, the &#8220;DataFlair_Stack&#8221; class uses a type parameter &#8220;T&#8221; to allow the class to work with any type of data. The &#8220;push&#8221; method takes a parameter of type &#8220;T&#8221; and adds it to the &#8220;items&#8221; array, while the &#8220;pop&#8221; method returns a value of type &#8220;T&#8221; from the end of the &#8220;items&#8221; array. The type parameter &#8220;T&#8221; is defined when creating a new instance of the &#8220;DataFlair_Stack&#8221; class, allowing the class to work with different types of data depending on the context.<\/p>\n<p>Templates in objects are a powerful tool for creating reusable and generic code that can work with a wide range of data types. They provide a flexible and type-safe way to work with data in TypeScript, making them an important language feature for developing scalable and maintainable applications.<\/p>\n<h3>Duck-typing in TypeScript<\/h3>\n<p>Duck typing is a type system used in TypeScript that determines the type of an object based on its behavior or methods rather than its class or interface definition. In other words, if an object walks like a duck and quacks like a duck, it is a duck.<\/p>\n<p>Duck typing allows TypeScript to be more flexible and dynamic when working with objects, enabling them to be used interchangeably as long as they have the same properties and methods. This can be particularly useful when working with objects with similar but not identical interfaces or with objects created dynamically at runtime.<\/p>\n<p>Here is an example of duck typing in TypeScript:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface DataFlair_Person {\r\n name: string;\r\n age: number;\r\n}\r\n\r\n\r\nfunction printPerson(person: DataFlair_Person) {\r\n console.log(`Name: ${person.name}, Age: ${person.age}`);\r\n}\r\n\r\n\r\nconst alice = { name: 'Alice', age: 25 };\r\nconst bob = { name: 'Bob', age: 30, gender: 'male' };\r\n\r\n\r\nprintPerson(alice); \r\nprintPerson(bob);\r\n<\/pre>\n<p><strong>Output &#8211;<\/strong><\/p>\n<div class=\"code-output\">Name: Alice, Age: 25<br \/>\nName: Bob, Age: 30<\/div>\n<p>In this example, the &#8220;printPerson&#8221; function takes an object of type &#8220;DataFlair_Person&#8221; as its parameter. However, the &#8220;bob&#8221; object does not explicitly implement the &#8220;Person&#8221; interface, as it has an additional &#8220;gender&#8221; property. Nevertheless, the &#8220;bob&#8221; object is still considered to be of type &#8220;DataFlair_Person&#8221; by TypeScript&#8217;s duck typing rules, as it has the same &#8220;name&#8221; and &#8220;age&#8221; properties as the &#8220;Person&#8221; interface.<\/p>\n<p>Duck typing can be a powerful tool for writing flexible and dynamic code in TypeScript. It allows objects to be used interchangeably based on their behavior rather than their explicit type definition. However, it can also lead to errors or unexpected behavior if objects with similar but not identical interfaces are used interchangeably. Therefore, it is important to use duck typing judiciously and with careful consideration of the objects being used.<\/p>\n<h3>Conclusion<\/h3>\n<p>In conclusion, TypeScript provides powerful features for working with objects, including inheritance, encapsulation, polymorphism, and interfaces. These features help developers write more maintainable, reusable, and scalable code by ensuring that objects are well-organized, secure, and easy to extend and modify. By mastering these concepts, developers can create sophisticated and robust applications that meet the needs of their users and stakeholders.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the core concepts of TypeScript is objects, which represent data structures in a program. In TypeScript, objects are instances of a class, which defines their properties and methods. Defining a class is&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":113038,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27319],"tags":[27355],"class_list":["post-112902","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-typescript-tutorials","tag-objects-in-typescript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Objects in TypeScript - DataFlair<\/title>\n<meta name=\"description\" content=\"TypeScript provides powerful features for working with objects, including inheritance, encapsulation, polymorphism &amp; interfaces. Learn more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Objects in TypeScript - DataFlair\" \/>\n<meta property=\"og:description\" content=\"TypeScript provides powerful features for working with objects, including inheritance, encapsulation, polymorphism &amp; interfaces. Learn more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-14T03:30:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-14T05:31:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-objects.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Objects in TypeScript - DataFlair","description":"TypeScript provides powerful features for working with objects, including inheritance, encapsulation, polymorphism & interfaces. Learn more.","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:\/\/data-flair.training\/blogs\/objects-in-typescript\/","og_locale":"en_US","og_type":"article","og_title":"Objects in TypeScript - DataFlair","og_description":"TypeScript provides powerful features for working with objects, including inheritance, encapsulation, polymorphism & interfaces. Learn more.","og_url":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-04-14T03:30:10+00:00","article_modified_time":"2023-04-14T05:31:37+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-objects.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"Objects in TypeScript","datePublished":"2023-04-14T03:30:10+00:00","dateModified":"2023-04-14T05:31:37+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/"},"wordCount":1126,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-objects.webp","keywords":["Objects in TypeScript"],"articleSection":["TypeScript Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/objects-in-typescript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/","url":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/","name":"Objects in TypeScript - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-objects.webp","datePublished":"2023-04-14T03:30:10+00:00","dateModified":"2023-04-14T05:31:37+00:00","description":"TypeScript provides powerful features for working with objects, including inheritance, encapsulation, polymorphism & interfaces. Learn more.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/objects-in-typescript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-objects.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-objects.webp","width":1200,"height":628,"caption":"typescript objects"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/objects-in-typescript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"TypeScript Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/typescript-tutorials\/"},{"@type":"ListItem","position":3,"name":"Objects in TypeScript"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam6\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/112902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=112902"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/112902\/revisions"}],"predecessor-version":[{"id":113043,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/112902\/revisions\/113043"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/113038"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=112902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=112902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=112902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}