{"id":22446,"date":"2020-09-11T01:07:54","date_gmt":"2020-09-11T08:07:54","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=22446"},"modified":"2020-12-29T13:46:53","modified_gmt":"2020-12-29T21:46:53","slug":"javascript-equality-operators","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/","title":{"rendered":"JavaScript: Equality Operators"},"content":{"rendered":"\n<p><em>There are four ways to compare equality in JavaScript. This article talks about the unique operators used to determine equality, what type coercion is, and some of the idiosyncrasies encountered when evaluating for a truthy or falsy value in the JavaScript language.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Strict Equality Comparison<\/h2>\n\n\n\n<p>The strict equality operator is represented by a triple equals sign (===). The purpose of this operator is to compare not only the value, but also its type.<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>const strictComparison = (a, b) =&gt; {\n console.log(typeof a);\n console.log(typeof b);\n return a === b;\n}\n \nstrictComparison(8, '8'); \/\/false\n<\/pre><\/div>\n\n\n\n<p>The <code>strictComparison<\/code> function in the example above takes in two values and returns whether or not the two values are strictly equal to one another.<br><\/p>\n\n\n\n<p>At first glance, the values look the same because they are both of value <em><code>8<\/code><\/em>. However, the strict equality operator also looks at the type. If we were to look at <em><code>a<\/code> <\/em>in this instance, and look at<code> <\/code><em><code>typeof a<\/code><\/em><code>,<\/code> it will return <code>\u2018number\u2019<\/code>. If we were to do the same to <em><code>b<\/code><\/em>, with <em><code>typeof b<\/code><\/em><code>,<\/code> it would return <code>\u2018string\u2019<\/code>.&nbsp;<br><\/p>\n\n\n\n<p>Because the types are not the same, it will return <em><code>false<\/code>.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Unusual Comparisons With ===<\/h3>\n\n\n\n<p>There are some unusual comparisons that can be made with the strict equal operator in JavaScript. Here are some that are commonly asked about in interview situations:<br><\/p>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td>Operand1<\/td><td><em>typeof<\/em> Operand1<\/td><td>Operand2<\/td><td><em>typeof<\/em> Operand2<\/td><td>Return Value<\/td><\/tr><tr><td>null<\/td><td>object<\/td><td>null<\/td><td>object<\/td><td>true<\/td><\/tr><tr><td>undefined<\/td><td>undefined<\/td><td>undefined<\/td><td>undefined<\/td><td>true<\/td><\/tr><tr><td>null<\/td><td>object<\/td><td>undefined<\/td><td>undefined<\/td><td>false<\/td><\/tr><tr><td>NaN<\/td><td>number<\/td><td>NaN<\/td><td>number<\/td><td>false<\/td><\/tr><tr><td>false<\/td><td>boolean<\/td><td>\u201cfalse\u201d<\/td><td>string<\/td><td>false<\/td><\/tr><tr><td>false<\/td><td>boolean<\/td><td>false<\/td><td>boolean<\/td><td>true<\/td><\/tr><tr><td>\u201c\u201d<\/td><td>string<\/td><td>\u201c\u201d<\/td><td>string<\/td><td>true<\/td><\/tr><tr><td>\u201c\u201d<\/td><td>string<\/td><td>undefined<\/td><td>undefined<\/td><td>false<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>One other thing to note is this will not do a comparison with data structures. You need to use a more sophisticated statement to compare arrays or objects.<br><\/p>\n\n\n\n<p>Most of the entries here evaluate the way they do because the types match or don\u2019t match. The one exception is <code>NaN<\/code> \u2013 this evaluates to <code>false<\/code> due to the fact that <code>NaN<\/code> can theoretically be anything \u2013 so there is no indication whether or not it could be equal, therefore evaluating to false.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Strict Inequality Comparison<\/h2>\n\n\n\n<p>The strict inequality operator is represented by an exclamation point and two equal signs (!==). It will evaluate whether or not the two values are NOT equal in value and type.<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>const strictInequalityComparison = (a, b) =&gt; {\n console.log(typeof a);\n console.log(typeof b);\n return a !== b;\n}\n \nstrictInequalityComparison(&quot;8&quot;, 8); \/\/true\n<\/pre><\/div>\n\n\n\n<p>The <code>strictInequalityComparison<\/code> function in the example above takes in two values and returns whether or not the two values are strictly not equal to one another.&nbsp;<br><\/p>\n\n\n\n<p>At first glance, the values look equal (and not unequal) because both have the same value. However, the strict inequality operator, like the strict equality operator, also looks at the type.&nbsp;<br><\/p>\n\n\n\n<p>If we were to look at <em><code>a<\/code> <\/em>in this instance, and look at <em><code>typeof a<\/code><\/em>, it will return <code>\u2018string\u2019<\/code>. If we were to do the same to <em><code>b<\/code><\/em>, with <em><code>typeof b<\/code><\/em>, it would return <code>\u2018number\u2019<\/code>. Because the types are not the same, it will return<code> <\/code><em><code>true<\/code>.&nbsp;<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Unusual Comparisons With !==<\/h3>\n\n\n\n<p>There are some unusual comparisons that can be made with the strict inequality operator in JavaScript. Here are some commonly asked about in interview situations:<br><\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>Operand1<\/td><td><em>typeof<\/em> Operand1<\/td><td>Operand2<\/td><td><em>typeof<\/em> Operand2<\/td><td>Return Value<\/td><\/tr><tr><td>null<\/td><td>object<\/td><td>null<\/td><td>object<\/td><td>false<\/td><\/tr><tr><td>undefined<\/td><td>undefined<\/td><td>undefined<\/td><td>undefined<\/td><td>false<\/td><\/tr><tr><td>null<\/td><td>object<\/td><td>undefined<\/td><td>undefined<\/td><td>true<\/td><\/tr><tr><td>NaN<\/td><td>number<\/td><td>NaN<\/td><td>number<\/td><td>true<\/td><\/tr><tr><td>false<\/td><td>boolean<\/td><td>\u201cfalse\u201d<\/td><td>string<\/td><td>true<\/td><\/tr><tr><td>false<\/td><td>boolean<\/td><td>false<\/td><td>boolean<\/td><td>false<\/td><\/tr><tr><td>\u201c\u201d<\/td><td>string<\/td><td>\u201c\u201d<\/td><td>string<\/td><td>false<\/td><\/tr><tr><td>\u201c\u201d<\/td><td>string<\/td><td>undefined<\/td><td>undefined<\/td><td>true<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Just like with the strict equality operator, comparisons cannot be made between objects or arrays.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">One More Thing\u2026<\/h3>\n\n\n\n<p>In most situations in your JavaScript development career, these two operators, the === and the !==, will be the ones that you will be writing your conditional logic with.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Loose Equality Comparison<\/h2>\n\n\n\n<p>The loose equality operator is represented by a double equals sign (==). The purpose of this operator is to coerce both values to a common type before evaluating whether or not it is equal. This is called <em>type coercion <\/em>or <em>type conversion<\/em>.<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>const looseComparison = (a, b) =&gt; {\n console.log(typeof a);\n console.log(typeof b);\n return a == b;\n}\n \nstrictComparison(8, '8'); \/\/true\n<\/pre><\/div>\n\n\n\n<p>The <code>looseComparison<\/code> function in the example above takes in two values and returns whether or not the two values are loosely equal to one another.&nbsp;<br><\/p>\n\n\n\n<p>At first glance, the values don\u2019t look the same because one is a number and one is a string. However, the loose equality operator doesn\u2019t look at the type. The statement will attempt to coerce the types to be the same before comparing the value &#8212; so the example will return true because the second operand is converted to a number and then compared.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Unusual Comparisons With ==<\/h3>\n\n\n\n<p>There are some unusual comparisons that can be made with the strict equal operator in JavaScript. Here are some commonly asked about in interview situations:&nbsp;<br><\/p>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td>Operand1<\/td><td><em>typeof<\/em> Operand1<\/td><td>Operand2<\/td><td><em>typeof<\/em> Operand2<\/td><td>Return Value<\/td><\/tr><tr><td>null<\/td><td>object<\/td><td>null<\/td><td>object<\/td><td>true<\/td><\/tr><tr><td>undefined<\/td><td>undefined<\/td><td>undefined<\/td><td>undefined<\/td><td>true<\/td><\/tr><tr><td>null<\/td><td>object<\/td><td>undefined<\/td><td>undefined<\/td><td>true<\/td><\/tr><tr><td>NaN<\/td><td>number<\/td><td>NaN<\/td><td>number<\/td><td>false<\/td><\/tr><tr><td>false<\/td><td>boolean<\/td><td>\u201cfalse\u201d<\/td><td>string<\/td><td>false<\/td><\/tr><tr><td>false<\/td><td>boolean<\/td><td>false<\/td><td>boolean<\/td><td>true<\/td><\/tr><tr><td>\u201c\u201d<\/td><td>string<\/td><td>\u201c\u201d<\/td><td>string<\/td><td>true<\/td><\/tr><tr><td>\u201c\u201d<\/td><td>string<\/td><td>undefined<\/td><td>undefined<\/td><td>false<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Most of the entries here evaluate the same as they did in the first section on strict equality. The notable exception is that <em>null<\/em> and <em>undefined<\/em> loosely compared evaluates to true.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Loose Inequality Comparison<\/h2>\n\n\n\n<p>The loose inequality operator is represented by an exclamation point and one equal sign (!=). It will evaluate whether or not the two values are NOT equal only in value. It does this by attempting to convert both arguments to be of the same type.<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre> const looseInequalityComparison = (a, b) =&gt; {\n console.log(typeof a);\n console.log(typeof b);\n return a != b;\n}\n \nlooseInequalityComparison(&quot;8&quot;, 8); \/\/false\n<\/pre><\/div>\n\n\n\n<p>The <code>looseInequalityComparison<\/code> function in the example above takes in two values and returns whether or not the two values are loosely not equal to one another.<br><\/p>\n\n\n\n<p>At first glance, the values look equal because they both have the same value. However, the loose inequality operator, like the loose equality operator, coerces the type to be the same on both operands before comparison. Because the values are the same after coercion, it will return <em><code>false<\/code>.&nbsp;<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Unusual Comparisons With !=<\/h3>\n\n\n\n<p>There are some unusual comparisons that can be made with the loose inequality operator in JavaScript. Here are some commonly asked about in interview situations:<br><\/p>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td>Operand1<\/td><td><em>typeof<\/em> Operand1<\/td><td>Operand2<\/td><td><em>typeof<\/em> Operand2<\/td><td>Return Value<\/td><\/tr><tr><td>null<\/td><td>object<\/td><td>null<\/td><td>object<\/td><td>false<\/td><\/tr><tr><td>undefined<\/td><td>undefined<\/td><td>undefined<\/td><td>undefined<\/td><td>false<\/td><\/tr><tr><td>null<\/td><td>object<\/td><td>undefined<\/td><td>undefined<\/td><td>false<\/td><\/tr><tr><td>NaN<\/td><td>number<\/td><td>NaN<\/td><td>number<\/td><td>true<\/td><\/tr><tr><td>false<\/td><td>boolean<\/td><td>\u201cfalse\u201d<\/td><td>string<\/td><td>true<\/td><\/tr><tr><td>false<\/td><td>boolean<\/td><td>false<\/td><td>boolean<\/td><td>false<\/td><\/tr><tr><td>\u201c\u201d<\/td><td>string<\/td><td>\u201c\u201d<\/td><td>string<\/td><td>false<\/td><\/tr><tr><td>\u201c\u201d<\/td><td>string<\/td><td>undefined<\/td><td>undefined<\/td><td>true<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Just like with the strict equality operator, comparisons cannot be made between objects or arrays.<br><\/p>\n\n\n\n<p>Most of the entries here evaluate the same as they did in the second section on strict inequality. The notable exception is that <em>null<\/em> and <em>undefined<\/em> loosely compared evaluates to false.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>This article has looked at the four ways to compare equality in JavaScript. The main thing to remember is triple equals (===) and double equals (==) are not the same operator. One evaluates strictly on type and value and the other only evaluates the value after trying to coerce both to be of the same type.<br><\/p>\n","protected":false},"excerpt":{"rendered":"There are four ways to compare equality in JavaScript. This article talks about the unique operators used to determine equality, what type coercion is, and some of the idiosyncrasies encountered when evaluating for a truthy or falsy value in the JavaScript language. Strict Equality Comparison The strict equality operator is represented by a triple equals&hellip;","protected":false},"author":77,"featured_media":22447,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[],"class_list":{"0":"post-22446","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-javascript"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"JavaScript","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>JavaScript: Equality Operators: A Complete Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"One of the more popular interview questions is to communicate the difference between == vs ===. Learn about the differences on Career Karma.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript: Equality Operators\" \/>\n<meta property=\"og:description\" content=\"One of the more popular interview questions is to communicate the difference between == vs ===. Learn about the differences on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-11T08:07:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-29T21:46:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/09\/xq7meiy_Wu25cQV82FM1qg01uRbQZE7VG5ZuE67qR87-ezjyMYn8EIXo7vhK76DP9x0V82-HD5uh1-yD5iMXV2RqnxUNWhqkx7BkIhlhOTrb1KeevMe79Q7Mr11cQ3mhr_hms18oJOi9Oaa2y6Z4-HnqjuoqQvL0i73h9IwpQcNfWyJqTHos2048.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"666\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Christina Kopecky\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Christina Kopecky\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/\"},\"author\":{\"name\":\"Christina Kopecky\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/ae0cdc4a5d198690d78482646894074e\"},\"headline\":\"JavaScript: Equality Operators\",\"datePublished\":\"2020-09-11T08:07:54+00:00\",\"dateModified\":\"2020-12-29T21:46:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/\"},\"wordCount\":1098,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/xq7meiy_Wu25cQV82FM1qg01uRbQZE7VG5ZuE67qR87-ezjyMYn8EIXo7vhK76DP9x0V82-HD5uh1-yD5iMXV2RqnxUNWhqkx7BkIhlhOTrb1KeevMe79Q7Mr11cQ3mhr_hms18oJOi9Oaa2y6Z4-HnqjuoqQvL0i73h9IwpQcNfWyJqTHos2048.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/\",\"name\":\"JavaScript: Equality Operators: A Complete Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/xq7meiy_Wu25cQV82FM1qg01uRbQZE7VG5ZuE67qR87-ezjyMYn8EIXo7vhK76DP9x0V82-HD5uh1-yD5iMXV2RqnxUNWhqkx7BkIhlhOTrb1KeevMe79Q7Mr11cQ3mhr_hms18oJOi9Oaa2y6Z4-HnqjuoqQvL0i73h9IwpQcNfWyJqTHos2048.jpg\",\"datePublished\":\"2020-09-11T08:07:54+00:00\",\"dateModified\":\"2020-12-29T21:46:53+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/ae0cdc4a5d198690d78482646894074e\"},\"description\":\"One of the more popular interview questions is to communicate the difference between == vs ===. Learn about the differences on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/xq7meiy_Wu25cQV82FM1qg01uRbQZE7VG5ZuE67qR87-ezjyMYn8EIXo7vhK76DP9x0V82-HD5uh1-yD5iMXV2RqnxUNWhqkx7BkIhlhOTrb1KeevMe79Q7Mr11cQ3mhr_hms18oJOi9Oaa2y6Z4-HnqjuoqQvL0i73h9IwpQcNfWyJqTHos2048.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/xq7meiy_Wu25cQV82FM1qg01uRbQZE7VG5ZuE67qR87-ezjyMYn8EIXo7vhK76DP9x0V82-HD5uh1-yD5iMXV2RqnxUNWhqkx7BkIhlhOTrb1KeevMe79Q7Mr11cQ3mhr_hms18oJOi9Oaa2y6Z4-HnqjuoqQvL0i73h9IwpQcNfWyJqTHos2048.jpg\",\"width\":1000,\"height\":666},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript-equality-operators\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript: Equality Operators\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/ae0cdc4a5d198690d78482646894074e\",\"name\":\"Christina Kopecky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/image-3-150x150.jpg\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/image-3-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/image-3-150x150.jpg\",\"caption\":\"Christina Kopecky\"},\"description\":\"Christina is an experienced technical writer, covering topics as diverse as Java, SQL, Python, and web development. She earned her Master of Music in flute performance from the University of Kansas and a bachelor's degree in music with minors in French and mass communication from Southeast Missouri State. Prior to joining the Career Karma team in June 2020, Christina was a teaching assistant, team lead, and section lead at Lambda School, where she led student groups, performed code and project reviews, and debugged problems for students. Christina's technical content is featured frequently in publications like Codecademy, Repl.it, and Educative.\",\"sameAs\":[\"http:\\\/\\\/www.linkedin.com\\\/in\\\/cmvnk\"],\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/author\\\/christina-kopecky\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"JavaScript: Equality Operators: A Complete Guide | Career Karma","description":"One of the more popular interview questions is to communicate the difference between == vs ===. Learn about the differences on Career Karma.","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:\/\/careerkarma.com\/blog\/javascript-equality-operators\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript: Equality Operators","og_description":"One of the more popular interview questions is to communicate the difference between == vs ===. Learn about the differences on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-09-11T08:07:54+00:00","article_modified_time":"2020-12-29T21:46:53+00:00","og_image":[{"width":1000,"height":666,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/09\/xq7meiy_Wu25cQV82FM1qg01uRbQZE7VG5ZuE67qR87-ezjyMYn8EIXo7vhK76DP9x0V82-HD5uh1-yD5iMXV2RqnxUNWhqkx7BkIhlhOTrb1KeevMe79Q7Mr11cQ3mhr_hms18oJOi9Oaa2y6Z4-HnqjuoqQvL0i73h9IwpQcNfWyJqTHos2048.jpg","type":"image\/jpeg"}],"author":"Christina Kopecky","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"Christina Kopecky","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/"},"author":{"name":"Christina Kopecky","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/ae0cdc4a5d198690d78482646894074e"},"headline":"JavaScript: Equality Operators","datePublished":"2020-09-11T08:07:54+00:00","dateModified":"2020-12-29T21:46:53+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/"},"wordCount":1098,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/09\/xq7meiy_Wu25cQV82FM1qg01uRbQZE7VG5ZuE67qR87-ezjyMYn8EIXo7vhK76DP9x0V82-HD5uh1-yD5iMXV2RqnxUNWhqkx7BkIhlhOTrb1KeevMe79Q7Mr11cQ3mhr_hms18oJOi9Oaa2y6Z4-HnqjuoqQvL0i73h9IwpQcNfWyJqTHos2048.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/","url":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/","name":"JavaScript: Equality Operators: A Complete Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/09\/xq7meiy_Wu25cQV82FM1qg01uRbQZE7VG5ZuE67qR87-ezjyMYn8EIXo7vhK76DP9x0V82-HD5uh1-yD5iMXV2RqnxUNWhqkx7BkIhlhOTrb1KeevMe79Q7Mr11cQ3mhr_hms18oJOi9Oaa2y6Z4-HnqjuoqQvL0i73h9IwpQcNfWyJqTHos2048.jpg","datePublished":"2020-09-11T08:07:54+00:00","dateModified":"2020-12-29T21:46:53+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/ae0cdc4a5d198690d78482646894074e"},"description":"One of the more popular interview questions is to communicate the difference between == vs ===. Learn about the differences on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/09\/xq7meiy_Wu25cQV82FM1qg01uRbQZE7VG5ZuE67qR87-ezjyMYn8EIXo7vhK76DP9x0V82-HD5uh1-yD5iMXV2RqnxUNWhqkx7BkIhlhOTrb1KeevMe79Q7Mr11cQ3mhr_hms18oJOi9Oaa2y6Z4-HnqjuoqQvL0i73h9IwpQcNfWyJqTHos2048.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/09\/xq7meiy_Wu25cQV82FM1qg01uRbQZE7VG5ZuE67qR87-ezjyMYn8EIXo7vhK76DP9x0V82-HD5uh1-yD5iMXV2RqnxUNWhqkx7BkIhlhOTrb1KeevMe79Q7Mr11cQ3mhr_hms18oJOi9Oaa2y6Z4-HnqjuoqQvL0i73h9IwpQcNfWyJqTHos2048.jpg","width":1000,"height":666},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/javascript-equality-operators\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/careerkarma.com\/blog\/javascript\/"},{"@type":"ListItem","position":3,"name":"JavaScript: Equality Operators"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/ae0cdc4a5d198690d78482646894074e","name":"Christina Kopecky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/image-3-150x150.jpg","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/image-3-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/image-3-150x150.jpg","caption":"Christina Kopecky"},"description":"Christina is an experienced technical writer, covering topics as diverse as Java, SQL, Python, and web development. She earned her Master of Music in flute performance from the University of Kansas and a bachelor's degree in music with minors in French and mass communication from Southeast Missouri State. Prior to joining the Career Karma team in June 2020, Christina was a teaching assistant, team lead, and section lead at Lambda School, where she led student groups, performed code and project reviews, and debugged problems for students. Christina's technical content is featured frequently in publications like Codecademy, Repl.it, and Educative.","sameAs":["http:\/\/www.linkedin.com\/in\/cmvnk"],"url":"https:\/\/careerkarma.com\/blog\/author\/christina-kopecky\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/22446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=22446"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/22446\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/22447"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=22446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=22446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=22446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}