

{"id":112684,"date":"2023-04-03T09:00:08","date_gmt":"2023-04-03T03:30:08","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=112684"},"modified":"2023-04-03T11:17:11","modified_gmt":"2023-04-03T05:47:11","slug":"operators-in-typescript","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/operators-in-typescript\/","title":{"rendered":"Operators in TypeScript"},"content":{"rendered":"<p>One crucial aspect of TypeScript is its operators, which are used to manipulate values in code. This article will cover TypeScript operators, including arithmetic, assignment, comparison, logical, and bitwise operators.<\/p>\n<p>Understanding TypeScript operators is essential for writing efficient and effective code. With TypeScript operators, developers can perform complex operations on data types, manipulate data, and make decisions based on certain conditions. In this way, operators are an essential part of the programming language, and learning how to use them effectively can help developers write better, more robust code. This article will explore the types of TypeScript operators and how to use them in your code.<\/p>\n<h3>Operators in TypeScript<\/h3>\n<h4>1. Arithmetic Operators<\/h4>\n<p>In TypeScript, arithmetic operators employ and execute mathematical operations on numeric values. In TypeScript, the following operators are available:<\/p>\n<p><strong>a. Addition (+):<\/strong> Adds two numeric values together.<\/p>\n<p><strong>b. Subtraction (-):<\/strong> Subtracts one numeric value from another.<\/p>\n<p><strong>c. Multiplication (*):<\/strong> Multiplies two numeric values together.<\/p>\n<p><strong>d. Division (\/):<\/strong> Division of two numerical values.<\/p>\n<p><strong>e. Modulus (%):<\/strong> Returns the remainder after division.<\/p>\n<p>Here is an example of using arithmetic operators in TypeScript:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_x = 10;\r\nlet DataFlair_y = 5;\r\nconsole.log(DataFlair_x + DataFlair_y);\r\nconsole.log(DataFlair_x - DataFlair_y);\r\nconsole.log(DataFlair_x * DataFlair_y);\r\nconsole.log(DataFlair_x \/ DataFlair_y);\r\nconsole.log(DataFlair_x % DataFlair_y);\r\n<\/pre>\n<p><strong>Output<\/strong> &#8211;<\/p>\n<div class=\"code-output\">15<br \/>\n5<br \/>\n50<br \/>\n2<br \/>\n0<\/div>\n<h4>2. Assignment Operators<\/h4>\n<p>Assignment operators are used to assigning values to variables in TypeScript. The following operators are available in TypeScript:<\/p>\n<p><strong>a. Assignment (=):<\/strong> Assigns a value to a variable.<\/p>\n<p><strong>b. Addition assignment (+=):<\/strong> Adds a value to a variable and assigns the result to the same variable.<\/p>\n<p><strong>c. Subtraction assignment (-=):<\/strong> Subtracts a value from a variable and assigns the result to the same variable.<\/p>\n<p><strong>d. Multiplication assignment (*=):<\/strong> Multiplies a variable by a value and assigns the result to the same variable.<\/p>\n<p><strong>e. Division assignment (\/=):<\/strong> Divides a variable by a value and assigns the result to the same variable.<\/p>\n<p><strong>f. Modulus assignment (%=):<\/strong> Performs modulus operation on a variable and a value and assigns the result to the same variable.<\/p>\n<p>Here is an example of using assignment operators in TypeScript:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_x = 10;\r\nDataFlair_x += 5;\r\nconsole.log(DataFlair_x);\r\n\r\n\r\nlet DataFlair_y = 10;\r\nDataFlair_y -= 5;\r\nconsole.log(DataFlair_y);\r\n\r\n\r\nlet DataFlair_z = 10;\r\nDataFlair_z *= 5;\r\nconsole.log(DataFlair_z);\r\n\r\n\r\nlet DataFlair_a = 10;\r\nDataFlair_a \/= 5;\r\nconsole.log(DataFlair_a);\r\n\r\n\r\nlet DataFlair_b = 10;\r\nDataFlair_b %= 5;\r\nconsole.log(DataFlair_b);\r\n<\/pre>\n<p><strong>Output<\/strong> &#8211;<\/p>\n<div class=\"code-output\">15<br \/>\n5<br \/>\n50<br \/>\n2<br \/>\n0<\/div>\n<h4>3. Comparison Operators in TypeScript<\/h4>\n<p>Comparison operators are used to comparing two values in TypeScript. The following operators are available in TypeScript:<\/p>\n<p><strong>a. Equal to (==):<\/strong> Compares two values for equality, but does not compare the data types of the values.<\/p>\n<p><strong>b. Not equal to (!=):<\/strong> Compares two values for inequality, but does not compare the data types of the values.<\/p>\n<p><strong>c. Strict equal to (===):<\/strong> Compares two values for equality, and compares the data types of the values.<\/p>\n<p><strong>d. Strict not equal to (!==):<\/strong> Compares two values for inequality and compares the data types of the values.<\/p>\n<p><strong>e. Greater than (&gt;):<\/strong> Determines whether one value exceeds another.<\/p>\n<p><strong>f. Less than (&lt;):<\/strong> Checks if one value is less than another.<\/p>\n<p><strong>g. Greater than or equal to (&gt;=):<\/strong> Check if one value is greater than or equal to another.<\/p>\n<p><strong>h. Less than or equal to (&lt;=):<\/strong> Checks if one value is less than or equal to another.<\/p>\n<p>Here is an example of using comparison operators in TypeScript:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_x = 10;\r\nlet DataFlair_y = 10;\r\nlet DataFlair_z = '10';\r\n\r\n\r\nconsole.log(DataFlair_x == DataFlair_y);\r\nconsole.log(DataFlair_x != DataFlair_y);\r\nconsole.log(DataFlair_x === DataFlair_y);\r\nconsole.log(DataFlair_x !== DataFlair_y);\r\n\r\n\r\nconsole.log(DataFlair_x &gt; DataFlair_y);\r\nconsole.log(DataFlair_x &lt; DataFlair_y);\r\nconsole.log(DataFlair_x &gt;= DataFlair_y);\r\nconsole.log(DataFlair_x &lt;= DataFlair_y);\r\n\r\n\r\nconsole.log(DataFlair_x == DataFlair_z);\r\nconsole.log(DataFlair_x === DataFlair_z);\r\n<\/pre>\n<p><strong>Output &#8211;<\/strong><\/p>\n<div class=\"code-output\">true<br \/>\nfalse<br \/>\ntrue<br \/>\nfalse<br \/>\nfalse<br \/>\nfalse<br \/>\ntrue<br \/>\ntrue<br \/>\ntrue<br \/>\nfalse<\/div>\n<h4>4. Logical Operators in TypeScript<\/h4>\n<p>Logical operators are used to performing logical operations on Boolean values in TypeScript. The following operators are available in TypeScript:<\/p>\n<p><strong>a. Logical AND (&amp;&amp;):<\/strong> Returns true if both operands are true.<\/p>\n<p><strong>b. Logical OR (||):<\/strong> Returns true if either operand is true.<\/p>\n<p><strong>c. Logical NOT (!):<\/strong> Returns the opposite of the Boolean value.<\/p>\n<p>Here is an example of using logical operators in TypeScript:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_x = true;\r\nlet DataFlair_y = false;\r\n\r\n\r\nconsole.log(DataFlair_x &amp;&amp; DataFlair_y);\r\nconsole.log(DataFlair_x || DataFlair_y);\r\nconsole.log(!DataFlair_x);\r\nconsole.log(!DataFlair_y);\r\n<\/pre>\n<p><strong>Output &#8211;<\/strong><\/p>\n<div class=\"code-output\">false<br \/>\ntrue<br \/>\nfalse<br \/>\ntrue<\/div>\n<h3>5. TypeScript Bitwise Operators<\/h3>\n<p>Bitwise operators are used to performing bitwise operations on numeric values in TypeScript. The following operators are available in TypeScript:<\/p>\n<p><strong>a. Bitwise AND (&amp;):<\/strong> Performs a bitwise AND operation on two values.<\/p>\n<p><strong>b. Bitwise OR (|):<\/strong> Performs a bitwise OR operation on two values.<\/p>\n<p><strong>c. Bitwise XOR (^):<\/strong> Performs a bitwise XOR operation on two values.<\/p>\n<p><strong>d. Bitwise NOT (~):<\/strong> Performs a bitwise NOT operation on a value.<\/p>\n<p><strong>e. Left shift (&lt;&lt;):<\/strong> Shifts the bits of a value to the left by a specified number of positions.<\/p>\n<p><strong>f. Signed right shift (&gt;&gt;):<\/strong> Shifts the bits of a value to the right by a specified number of positions, preserving the sign of the value.<\/p>\n<p><strong>g. Unsigned right shift (&gt;&gt;&gt;):<\/strong> Shifts the bits of a value to the right by a specified number of positions but always fills the empty bits with zeros.<\/p>\n<p>Here is an example of using bitwise operators in TypeScript:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_x = 5;\r\nlet DataFlair_y = 3;\r\n\r\n\r\nconsole.log(DataFlair_x &amp; DataFlair_y);\r\nconsole.log(DataFlair_x | DataFlair_y);\r\nconsole.log(DataFlair_x ^ DataFlair_y);\r\nconsole.log(~DataFlair_x);\r\nconsole.log(DataFlair_x &lt;&lt; 1);\r\nconsole.log(DataFlair_x &gt;&gt; 1);\r\nconsole.log(DataFlair_x &gt;&gt;&gt; 1);\r\n<\/pre>\n<p><strong>Output<\/strong> &#8211;<\/p>\n<div class=\"code-output\">1<br \/>\n7<br \/>\n6<br \/>\n-6<br \/>\n10<br \/>\n2<br \/>\n2<\/div>\n<h4>Misc Operators in TypeScript<\/h4>\n<p>In TypeScript, several miscellaneous operators need to fit into a specific category. These operators are generally used for particular purposes and may not be as commonly used as others.<\/p>\n<p>One such operator is the <strong>conditional operator<\/strong> (also known as the ternary operator), which is used to evaluate a condition and return one value if the condition is true, and another value if the state is false. The syntax for the conditional operator is condition ? valueIfTrue : valueIfFalse.<\/p>\n<p>Another miscellaneous operator is the <strong>comma operator<\/strong>, which allows multiple expressions to be evaluated in a single statement. The comma operator evaluates each expression in order, from left to right, and returns the value of the last expression. This operator is primarily used for its side effects, such as updating multiple variables or executing numerous functions in a single line of code.<\/p>\n<p>The <strong>void operator<\/strong> is also considered a miscellaneous operator in TypeScript. This operator evaluates an expression and returns undefined. It is often used to indicate that a function does not explicitly return a value or prevent the browser from following a link when used with an HTML anchor tag.<\/p>\n<p>While these operators may not be as commonly used as others in TypeScript, they can be helpful in certain situations. They can help improve the readability and efficiency of your code. Understanding how these operators work and when to use them appropriately is essential.<\/p>\n<h4>Concatenation Operator<\/h4>\n<p>In TypeScript, the concatenation operator is represented by the plus sign (+) and combines two or more strings or values into a single string. When the plus sign combines two values, TypeScript automatically converts non-string values to strings before concatenating them.<\/p>\n<p>For example, if we have two strings, &#8220;Hello&#8221; and &#8220;World,&#8221; we can concatenate them using the plus sign as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_greeting: string = 'Hello';\r\nlet DataFlair_name: string = 'World';\r\nlet message: string = DataFlair_greeting + ' ' + name;\r\nconsole.log(message); \/\/ outputs \"Hello World\"\r\n<\/pre>\n<p><strong>Output &#8211;<\/strong><\/p>\n<div class=\"code-output\">Hello World<\/div>\n<h4>Type Operator in TypeScript<\/h4>\n<p>TypeScript also has a type operator called the typeof operator, which is used to get the type of a variable or expression at compile time. The typeof operator returns a string that represents the data type of the operand.<\/p>\n<p>For example, if we have a variable DataFlair_x of type number, we can use the typeof operator to get its type as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_x: number = 10;\r\nconsole.log(typeof DataFlair_x);\r\n<\/pre>\n<p><strong>Output<\/strong> &#8211;<\/p>\n<div class=\"code-output\">number<\/div>\n<p>The typeof operator can also be used with expressions, functions, and classes to get their types. This is useful when you need to check the type of a variable or parameter at runtime.<\/p>\n<h4>String Operator in TypeScript<\/h4>\n<p>The string operator is represented by the plus sign (+) and is used to concatenate strings or string-like objects together. The string operator can also be used to convert non-string values to strings.<\/p>\n<p>For example, if we have two strings &#8220;Hello&#8221; and &#8220;World&#8221;, we can concatenate them using the plus sign as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_greeting: string = 'Hello';\r\nlet DataFlair_name: string = 'World';\r\nlet message: string = DataFlair_greeting + ' ' + DataFlair_name;\r\nconsole.log(message); \/\/ outputs \"Hello World\"\r\n<\/pre>\n<p><strong>Output<\/strong> &#8211;<\/p>\n<div class=\"code-output\">Hello World<\/div>\n<p>The string operator can also be used to convert other data types to strings. For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_num: number = 42;\r\nlet str: string = 'The answer is ' + DataFlair_num;\r\nconsole.log(str); \/\/ outputs \"The answer is 42\"\r\n<\/pre>\n<p><strong>Output<\/strong>&#8211;<\/p>\n<div class=\"code-output\">42<\/div>\n<p>In this example, the number 42 is implicitly converted to a string using the string operator.<\/p>\n<p>It&#8217;s worth noting that there is also a template literal syntax in TypeScript which uses backticks (`) instead of quotes to define a string. Template literals can contain placeholders which are surrounded by ${} and can contain expressions. Template literals are also used for multiline strings. Here&#8217;s an example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_name: string = 'John';\r\nlet age: number = 30;\r\nlet str: string = `My name is ${DataFlair_name} and I am ${age} years old.`;\r\nconsole.log(str); \/\/ outputs \"My name is John and I am 30 years old.\"\r\n<\/pre>\n<p><strong>Output<\/strong> &#8211;<\/p>\n<div class=\"code-output\">My name is John and I am 30 years old.<\/div>\n<p>Template literals are often preferred over the string operator when building complex or multiline strings because they are easier to read and maintain.<\/p>\n<h3>Types of Operator in TypeScript:<\/h3>\n<p>In TypeScript, operators can be classified into three categories based on the number of operands they take: unary, binary, and ternary operators.<\/p>\n<h4>1. Unary Operator<\/h4>\n<p>Unary operators are operators that take a single operand. Some examples of unary operators in TypeScript are the negation operator (-), the logical not operator (!), and the typeof operator.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_x: number = -10;\r\nlet DataFlair_y: boolean = !true;\r\nlet DataFlair_z: string = typeof 'hello';\r\n<\/pre>\n<h4>2. Binary Operator<\/h4>\n<p>Binary operators are operators that take two operands. Some examples of binary operators in TypeScript are the addition operator (+), the subtraction operator (-), the multiplication operator (*), and the logical and operator (&amp;&amp;).<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_a: number = 5 + 3;\r\nlet DataFlair_b: number = 10 - 5;\r\nlet DataFlair_c: number = 3 * 4;\r\nlet DataFlair_d: boolean = true &amp;&amp; false;\r\n<\/pre>\n<h4>3. Ternary Operator<\/h4>\n<p>The ternary operator is the only operator in TypeScript that takes three operands. It is represented by the ? and : symbols and is used as a shorthand for if-else statements.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let DataFlair_age: number = 25;\r\nlet DataFlair_message: string = DataFlair_age &gt;= 18 ? 'You are an adult' : 'You are not an adult';\r\n<\/pre>\n<h3>Conclusion<\/h3>\n<p>In conclusion, TypeScript operators are a key component of the language and enable developers to manipulate values in code. The different types of operators available in TypeScript include arithmetic, assignment, comparison, logical, and bitwise operators. This allows developers to perform a wide range of operations in their code. Developers need to understand the syntax and functionality of these operators to write efficient and effective code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One crucial aspect of TypeScript is its operators, which are used to manipulate values in code. This article will cover TypeScript operators, including arithmetic, assignment, comparison, logical, and bitwise operators. Understanding TypeScript operators is&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":112966,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27319],"tags":[27344],"class_list":["post-112684","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-typescript-tutorials","tag-operators-in-typescript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Operators in TypeScript - DataFlair<\/title>\n<meta name=\"description\" content=\"TypeScript operators are a key component of the language and enable developers to manipulate values in code. See its types with examples.\" \/>\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\/operators-in-typescript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Operators in TypeScript - DataFlair\" \/>\n<meta property=\"og:description\" content=\"TypeScript operators are a key component of the language and enable developers to manipulate values in code. See its types with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/operators-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-03T03:30:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-03T05:47:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-operators.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=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Operators in TypeScript - DataFlair","description":"TypeScript operators are a key component of the language and enable developers to manipulate values in code. See its types with examples.","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\/operators-in-typescript\/","og_locale":"en_US","og_type":"article","og_title":"Operators in TypeScript - DataFlair","og_description":"TypeScript operators are a key component of the language and enable developers to manipulate values in code. See its types with examples.","og_url":"https:\/\/data-flair.training\/blogs\/operators-in-typescript\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-04-03T03:30:08+00:00","article_modified_time":"2023-04-03T05:47:11+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-operators.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":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/operators-in-typescript\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/operators-in-typescript\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"Operators in TypeScript","datePublished":"2023-04-03T03:30:08+00:00","dateModified":"2023-04-03T05:47:11+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/operators-in-typescript\/"},"wordCount":1482,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/operators-in-typescript\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-operators.webp","keywords":["Operators in TypeScript"],"articleSection":["TypeScript Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/operators-in-typescript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/operators-in-typescript\/","url":"https:\/\/data-flair.training\/blogs\/operators-in-typescript\/","name":"Operators in TypeScript - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/operators-in-typescript\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/operators-in-typescript\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-operators.webp","datePublished":"2023-04-03T03:30:08+00:00","dateModified":"2023-04-03T05:47:11+00:00","description":"TypeScript operators are a key component of the language and enable developers to manipulate values in code. See its types with examples.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/operators-in-typescript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/operators-in-typescript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/operators-in-typescript\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-operators.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/typescript-operators.webp","width":1200,"height":628,"caption":"typescript operators"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/operators-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":"Operators 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\/112684","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=112684"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/112684\/revisions"}],"predecessor-version":[{"id":112970,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/112684\/revisions\/112970"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/112966"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=112684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=112684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=112684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}