{"id":1299,"date":"2021-04-10T10:28:52","date_gmt":"2021-04-10T04:58:52","guid":{"rendered":"https:\/\/myfreeonlinetools.com\/blog\/?p=1299"},"modified":"2021-04-10T10:29:46","modified_gmt":"2021-04-10T04:59:46","slug":"javascript-operator-and-or-define-with-logical-condition","status":"publish","type":"post","link":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/","title":{"rendered":"JavaScript Operator and &#038;&#038;, or || define with logical condition"},"content":{"rendered":"<h2>JavaScript Operator &amp;&amp; (AND), ||(OR).<\/h2>\n<p><img decoding=\"async\" class=\"size-full wp-image-1300 aligncenter\" src=\"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define.jpg\" alt=\"&amp;&amp; and || Operators in JavaScript\" width=\"100%\" srcset=\"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define.jpg 600w, https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define-111x300.jpg 111w, https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define-381x1030.jpg 381w, https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define-554x1500.jpg 554w, https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define-260x705.jpg 260w, https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define-369x999.jpg 369w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>They perform some operations on single or multiple values and provide results.<\/p>\n<p>and like that double pipes represent the logical OR operator.<\/p>\n<h3>Logical AND Operator<\/h3>\n<p>Double ampersand to represent the logical AND operator<\/p>\n<p>true &amp;&amp; true; \/\/ true<\/p>\n<p>true &amp;&amp; false; \/\/<\/p>\n<p>false false &amp;&amp; true; \/\/<\/p>\n<p>false false &amp;&amp; false; \/\/ false<\/p>\n<h3>Logical OR Operator<\/h3>\n<p>true &amp;&amp; true; \/\/ true<\/p>\n<p>true &amp;&amp; false; \/\/ true<\/p>\n<p>false &amp;&amp; true; \/\/ true<\/p>\n<p>false &amp;&amp; false; \/\/ false<\/p>\n<p>Using Only Two Boolen Value True and False<\/p>\n<p>Expalin by Example<\/p>\n<h3>&amp;&amp; Operator<\/h3>\n<pre>const a = 6;\r\nconst b = -2;\r\nconsole.log(a &gt; 0 &amp;&amp; b &gt; 0);\r\n\/\/ expected output: false<\/pre>\n<h3>|| Operator<\/h3>\n<pre>const a = 6;\r\nconst b = -2;\r\nconsole.log(a &gt; 0 || b &gt; 0);\r\n\/\/ expected output: true<\/pre>\n<p>&nbsp;<\/p>\n<p>The logical AND (&amp;&amp;) operator for a set of operands is true if and only if all of its operands are true.<\/p>\n<p>The logical OR (||) operator for a set of operands is true if and only if one or more of its operands is true.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript Operator &amp;&amp; (AND), ||(OR). They perform some operations on single or multiple values and provide results. and like that double pipes represent the logical OR operator. Logical AND Operator [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1299","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JavaScript Operator and &amp;&amp;, or || define with logical condition - MyFreeOnlineTools<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Operator and &amp;&amp;, or || define with logical condition - MyFreeOnlineTools\" \/>\n<meta property=\"og:description\" content=\"JavaScript Operator &amp;&amp; (AND), ||(OR). They perform some operations on single or multiple values and provide results. and like that double pipes represent the logical OR operator. Logical AND Operator [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/\" \/>\n<meta property=\"og:site_name\" content=\"MyFreeOnlineTools\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/LearnSchoolOnline\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-10T04:58:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-10T04:59:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define.jpg\" \/>\n<meta name=\"author\" content=\"myfreeonlinetools\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"myfreeonlinetools\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/\"},\"author\":{\"name\":\"myfreeonlinetools\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/person\/b1eb72e57c554e3b33cfeec477efcc3c\"},\"headline\":\"JavaScript Operator and &#038;&#038;, or || define with logical condition\",\"datePublished\":\"2021-04-10T04:58:52+00:00\",\"dateModified\":\"2021-04-10T04:59:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/\"},\"wordCount\":152,\"publisher\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define.jpg\",\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/\",\"url\":\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/\",\"name\":\"JavaScript Operator and &&, or || define with logical condition - MyFreeOnlineTools\",\"isPartOf\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define.jpg\",\"datePublished\":\"2021-04-10T04:58:52+00:00\",\"dateModified\":\"2021-04-10T04:59:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#primaryimage\",\"url\":\"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define.jpg\",\"contentUrl\":\"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/myfreeonlinetools.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript Operator and &#038;&#038;, or || define with logical condition\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#website\",\"url\":\"https:\/\/myfreeonlinetools.com\/blog\/\",\"name\":\"MyFreeOnlineTools\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/myfreeonlinetools.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#organization\",\"name\":\"MyFreeOnlineTools\",\"url\":\"https:\/\/myfreeonlinetools.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2019\/11\/myfreeonlinetools-blue.png\",\"contentUrl\":\"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2019\/11\/myfreeonlinetools-blue.png\",\"width\":387,\"height\":79,\"caption\":\"MyFreeOnlineTools\"},\"image\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/person\/b1eb72e57c554e3b33cfeec477efcc3c\",\"name\":\"myfreeonlinetools\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b870b17c6c7e3b75d7fe0b8bebfc9cf5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b870b17c6c7e3b75d7fe0b8bebfc9cf5?s=96&d=mm&r=g\",\"caption\":\"myfreeonlinetools\"},\"description\":\"Live in Delhi, Working in Gurgaon as Web Designer and Graphic Designer. Developed and Design myfreeonlinetools for online free tools. Also having youtube channel Name with LearnSchoolOnline. Traveling, watching movies, coding are the hobbies.\",\"sameAs\":[\"https:\/\/myfreeonlinetools.com\/\",\"https:\/\/www.facebook.com\/LearnSchoolOnline\/\",\"https:\/\/www.youtube.com\/learnschoolonline\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JavaScript Operator and &&, or || define with logical condition - MyFreeOnlineTools","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:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Operator and &&, or || define with logical condition - MyFreeOnlineTools","og_description":"JavaScript Operator &amp;&amp; (AND), ||(OR). They perform some operations on single or multiple values and provide results. and like that double pipes represent the logical OR operator. Logical AND Operator [&hellip;]","og_url":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/","og_site_name":"MyFreeOnlineTools","article_author":"https:\/\/www.facebook.com\/LearnSchoolOnline\/","article_published_time":"2021-04-10T04:58:52+00:00","article_modified_time":"2021-04-10T04:59:46+00:00","og_image":[{"url":"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define.jpg","type":"","width":"","height":""}],"author":"myfreeonlinetools","twitter_card":"summary_large_image","twitter_misc":{"Written by":"myfreeonlinetools","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#article","isPartOf":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/"},"author":{"name":"myfreeonlinetools","@id":"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/person\/b1eb72e57c554e3b33cfeec477efcc3c"},"headline":"JavaScript Operator and &#038;&#038;, or || define with logical condition","datePublished":"2021-04-10T04:58:52+00:00","dateModified":"2021-04-10T04:59:46+00:00","mainEntityOfPage":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/"},"wordCount":152,"publisher":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/#organization"},"image":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#primaryimage"},"thumbnailUrl":"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define.jpg","inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/","url":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/","name":"JavaScript Operator and &&, or || define with logical condition - MyFreeOnlineTools","isPartOf":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#primaryimage"},"image":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#primaryimage"},"thumbnailUrl":"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define.jpg","datePublished":"2021-04-10T04:58:52+00:00","dateModified":"2021-04-10T04:59:46+00:00","breadcrumb":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#primaryimage","url":"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define.jpg","contentUrl":"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2021\/04\/javascript-operator-and-or-difference-and-define.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/myfreeonlinetools.com\/blog\/javascript-operator-and-or-define-with-logical-condition\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/myfreeonlinetools.com\/blog\/"},{"@type":"ListItem","position":2,"name":"JavaScript Operator and &#038;&#038;, or || define with logical condition"}]},{"@type":"WebSite","@id":"https:\/\/myfreeonlinetools.com\/blog\/#website","url":"https:\/\/myfreeonlinetools.com\/blog\/","name":"MyFreeOnlineTools","description":"","publisher":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/myfreeonlinetools.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/myfreeonlinetools.com\/blog\/#organization","name":"MyFreeOnlineTools","url":"https:\/\/myfreeonlinetools.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2019\/11\/myfreeonlinetools-blue.png","contentUrl":"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2019\/11\/myfreeonlinetools-blue.png","width":387,"height":79,"caption":"MyFreeOnlineTools"},"image":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/person\/b1eb72e57c554e3b33cfeec477efcc3c","name":"myfreeonlinetools","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b870b17c6c7e3b75d7fe0b8bebfc9cf5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b870b17c6c7e3b75d7fe0b8bebfc9cf5?s=96&d=mm&r=g","caption":"myfreeonlinetools"},"description":"Live in Delhi, Working in Gurgaon as Web Designer and Graphic Designer. Developed and Design myfreeonlinetools for online free tools. Also having youtube channel Name with LearnSchoolOnline. Traveling, watching movies, coding are the hobbies.","sameAs":["https:\/\/myfreeonlinetools.com\/","https:\/\/www.facebook.com\/LearnSchoolOnline\/","https:\/\/www.youtube.com\/learnschoolonline"]}]}},"_links":{"self":[{"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/1299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/comments?post=1299"}],"version-history":[{"count":0,"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/1299\/revisions"}],"wp:attachment":[{"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/media?parent=1299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/categories?post=1299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/tags?post=1299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}