{"id":5282,"date":"2023-12-08T07:14:09","date_gmt":"2023-12-08T07:14:09","guid":{"rendered":"https:\/\/resizemyimg.com\/blog\/?p=5282"},"modified":"2024-09-02T22:48:31","modified_gmt":"2024-09-02T22:48:31","slug":"everything-important-to-know-about-nan-in-javascript","status":"publish","type":"post","link":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/","title":{"rendered":"Everything Important to Know About NaN in JavaScript"},"content":{"rendered":"<p>NaN (<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/NaN\">Not-a-Number<\/a>) is a special value in JavaScript that represents an invalid or undefined numerical operation. Understanding NaN is important for writing robust JavaScript code that handles invalid data gracefully. Here, we have explained important things about NaN in JS.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3485\" src=\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/man-working-on-two-laptops.jpg\" alt=\"Man working on two laptops\" width=\"1800\" height=\"1200\" srcset=\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/man-working-on-two-laptops.jpg 1800w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/man-working-on-two-laptops-300x200.jpg 300w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/man-working-on-two-laptops-1024x683.jpg 1024w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/man-working-on-two-laptops-575x383.jpg 575w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/man-working-on-two-laptops-768x512.jpg 768w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/man-working-on-two-laptops-1536x1024.jpg 1536w\" sizes=\"(max-width: 1800px) 100vw, 1800px\" \/><\/p>\n<h2>What is NaN?<\/h2>\n<p>So first, you need to understand <a href=\"https:\/\/uploadcare.com\/blog\/what-is-nan\/\">what is NaN in JS<\/a>. NaN stands for &#8220;Not-a-Number&#8221;. It is a property of the global JavaScript object that represents a value that is not a legal number.<\/p>\n<p>Some key things to know about NaN:<\/p>\n<ul>\n<li>Its type is<em>number\u00a0(typeof NaN<\/em>\u00a0returns\u00a0<em>&#8220;number&#8221;)<\/em><\/li>\n<li>It is the return value from operations that have an undefined or unrepresentable numerical value<\/li>\n<li>It compares unequal (via\u00a0<em>==,\u00a0!=,\u00a0===,<\/em> and\u00a0<em>!==<\/em>) to any other value \u2014 including another\u00a0<em>NaN<\/em>value<\/li>\n<\/ul>\n<p>Here are some examples of where NaN can occur:<\/p>\n<p><em>Math.sqrt(-1); \/\/ NaN <\/em><\/p>\n<p><em>\u00a0<\/em><\/p>\n<p><em>parseInt(&#8220;hello&#8221;); \/\/ NaN<\/em><\/p>\n<p><em>\u00a0<\/em><\/p>\n<p><em>Infinity &#8211; Infinity; \/\/ NaN<\/em><\/p>\n<p><em>\u00a0<\/em><\/p>\n<p><em>0 * Infinity; \/\/ NaN<\/em><\/p>\n<p>NaN also propagates in further calculations, meaning any math operation on NaN will also return NaN:<\/p>\n<p><em>NaN + 5; \/\/ NaN<\/em><\/p>\n<p><em>\u00a0<\/em><\/p>\n<p><em>10 \/ NaN; \/\/ NaN<\/em><\/p>\n<h2>How to Check for NaN<\/h2>\n<p>Since NaN compares unequal to everything, including itself, you cannot use traditional comparison operators like\u00a0<em>==<\/em>\u00a0or\u00a0<em>===<\/em>\u00a0to check if a value is NaN.<\/p>\n<p><strong>You should also check: <\/strong><a href=\"https:\/\/resizemyimg.com\/blog\/these-4-things-are-slowing-your-website-down\/\"><strong>These 4 Things Are Slowing Your Website Down<\/strong><\/a><\/p>\n<p>Instead, JavaScript provides the global\u00a0<em>isNaN()<\/em>\u00a0function:<\/p>\n<p><em>isNaN(NaN); \/\/ true<\/em><\/p>\n<p>However,\u00a0<em>isNaN()<\/em>\u00a0has some tricky behavior to be aware of:<\/p>\n<ul>\n<li>It will coerce the value to a number before checking if it&#8217;s NaN<\/li>\n<li>Values like\u00a0<em>&#8220;hello&#8221;,\u00a0undefined,<\/em> and\u00a0<em>[]<\/em>will coerce to NaN, so\u00a0<em>isNaN()<\/em>\u00a0will return\u00a0<em>true<\/em>\u00a0for those<\/li>\n<\/ul>\n<p>To avoid this, ES6 introduced\u00a0<em>Number.isNaN()<\/em>\u00a0which doesn&#8217;t coerce the value:<\/p>\n<p><em>Number.isNaN(NaN); \/\/ true<\/em><\/p>\n<p><em>Number.isNaN(&#8220;hello&#8221;); \/\/ false<\/em><\/p>\n<p><em>Number.isNaN()<\/em>\u00a0is considered the most robust way to check for NaN.<\/p>\n<p>An alternative approach is to check if the value is unequal to itself:<\/p>\n<p><em>const value = NaN;<\/em><\/p>\n<p><em>value !== value; \/\/ true<\/em><\/p>\n<p>This works because NaN is the only value not equal to itself.<\/p>\n<h2>Where NaN Comes From<\/h2>\n<p>There are a few main ways that NaN can occur in JavaScript:<\/p>\n<h3>1. Parsing Invalid Numbers<\/h3>\n<p>NaN is returned from functions like\u00a0<em>parseInt()<\/em>\u00a0and\u00a0<em>parseFloat()<\/em>\u00a0when they are passed values that cannot be converted to numbers:<\/p>\n<p><em>parseInt(&#8220;hello&#8221;); \/\/ NaN <\/em><em>\u00a0<\/em><\/p>\n<p><em>parseFloat(&#8220;10.5abc&#8221;); \/\/ NaN<\/em><\/p>\n<h3>2. Math Operations on Non-Numbers<\/h3>\n<p>If you perform math operations on non-number values, NaN is returned:<\/p>\n<p><em>&#8220;hello&#8221; &#8211; 5; \/\/ NaN<\/em><\/p>\n<p><em>Infinity \/ Infinity; \/\/ NaN<\/em><\/p>\n<h3>3. Indeterminate Forms<\/h3>\n<p>Certain forms of math operations have an undefined value, which results in NaN:<\/p>\n<p><em>0 * Infinity; \/\/ NaN<\/em><\/p>\n<p><em>Infinity &#8211; Infinity; \/\/ NaN<\/em><\/p>\n<h3>4. Using NaN in Further Math Operations<\/h3>\n<p>Since NaN represents an invalid number, any further math done with NaN will also return NaN:<\/p>\n<p><em>NaN + 5; \/\/ NaN<\/em><\/p>\n<p><em>10 \/ NaN; \/\/ NaN<\/em><\/p>\n<p>This means NaN can propagate through code if you&#8217;re not careful to check for it.<\/p>\n<h2>How to Handle NaN in Your Code<\/h2>\n<p>Since NaN represents invalid data and it is one of the <a href=\"https:\/\/www.freecodecamp.org\/news\/nine-most-common-mistakes-developers-make-in-javascript\/\">most common mistakes developers make in JavaScript<\/a>, you may want to find and handle it appropriately instead of letting it silently propagate through your code.<\/p>\n<p>Here are some tips for properly handling NaN values:<\/p>\n<ul>\n<li>Use\u00a0<em>isNaN()<\/em>or\u00a0<em>myValue !== myValue<\/em>\u00a0to check if values are NaN<\/li>\n<li>Use\u00a0<em>isFinite()<\/em>to check if a numeric value is a regular number<\/li>\n<li>Catch NaN with\u00a0<em>if<\/em>statements and either handle it specially or replace it with a defined value like\u00a0<em>0<\/em><\/li>\n<li><em>Use<\/em><em>NaN<\/em>\u00a0as the default parameter value for optional numeric parameters to catch\u00a0<em>undefined<\/em>\u00a0values:<\/li>\n<\/ul>\n<p><em>function myFunction(n = NaN) {<\/em><\/p>\n<p><em>\u00a0 if (Number.isNaN(n)) {<\/em><\/p>\n<p><em>\u00a0\u00a0\u00a0 n = 0; \/\/ handle if NaN<\/em><\/p>\n<p><em>\u00a0 }<\/em><\/p>\n<p><em>}<\/em><\/p>\n<p>Properly handling NaN will make your code more robust and prevent subtle bugs!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3569\" src=\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/laptop-on-desk.jpg\" alt=\"Laptop on desk\" width=\"1280\" height=\"853\" srcset=\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/laptop-on-desk.jpg 1280w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/laptop-on-desk-300x200.jpg 300w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/laptop-on-desk-1024x682.jpg 1024w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/laptop-on-desk-575x383.jpg 575w, https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2021\/08\/laptop-on-desk-768x512.jpg 768w\" sizes=\"(max-width: 1280px) 100vw, 1280px\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>NaN is an important concept to understand to write solid JavaScript code:<\/p>\n<ul>\n<li>It represents invalid numerical data<\/li>\n<li>It propagates through further math operations<\/li>\n<li>It compares unequal to everything, including itself<\/li>\n<li><em>isNaN()<\/em>and\u00a0<em>isNaN()\u00a0<\/em>can detect it<\/li>\n<li>It should be handled gracefully instead of propagating<\/li>\n<\/ul>\n<p>By learning how to test for and handle NaN, you can make your code more resilient to bad data.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NaN (<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/NaN\">Not-a-Number<\/a>) is a special value in JavaScript that represents an invalid or undefined numerical operation. Understanding NaN is important for writing robust JavaScript code that handles invalid data gracefully. Here, we have explained important things about NaN in JS. <\/p>\n<p class=\"read-more-container\"><a href=\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/\" class=\"read-more button\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":5283,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[230,231,232],"class_list":["post-5282","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-java","tag-javascript","tag-programming","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Everything Important to Know About NaN in JavaScript<\/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:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Everything Important to Know About NaN in JavaScript\" \/>\n<meta property=\"og:description\" content=\"NaN (Not-a-Number) is a special value in JavaScript that represents an invalid or undefined numerical operation. Understanding NaN is important for writing robust JavaScript code that handles invalid data gracefully. Here, we have explained important things about NaN in JS. Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"Resize my Image Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webfactoryltd\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-08T07:14:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-02T22:48:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2023\/12\/everything-important-to-know-about-nan-in-javascript.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"800\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"gordan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webfactoryltd\" \/>\n<meta name=\"twitter:site\" content=\"@webfactoryltd\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"gordan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/\"},\"author\":{\"name\":\"gordan\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/#\/schema\/person\/6b80bbcf3f1d17805d134728bd589c22\"},\"headline\":\"Everything Important to Know About NaN in JavaScript\",\"datePublished\":\"2023-12-08T07:14:09+00:00\",\"dateModified\":\"2024-09-02T22:48:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/\"},\"wordCount\":643,\"publisher\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2023\/12\/everything-important-to-know-about-nan-in-javascript.jpg\",\"keywords\":[\"java\",\"javascript\",\"programming\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/\",\"url\":\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/\",\"name\":\"Everything Important to Know About NaN in JavaScript\",\"isPartOf\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2023\/12\/everything-important-to-know-about-nan-in-javascript.jpg\",\"datePublished\":\"2023-12-08T07:14:09+00:00\",\"dateModified\":\"2024-09-02T22:48:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#primaryimage\",\"url\":\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2023\/12\/everything-important-to-know-about-nan-in-javascript.jpg\",\"contentUrl\":\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2023\/12\/everything-important-to-know-about-nan-in-javascript.jpg\",\"width\":1600,\"height\":800,\"caption\":\"Everything Important to Know About NaN in JavaScript\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/resizemyimg.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Everything Important to Know About NaN in JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/#website\",\"url\":\"https:\/\/resizemyimg.com\/blog\/\",\"name\":\"Resize my Image Blog\",\"description\":\"News, insights, tips&amp;tricks on image related business &amp; SaaS\",\"publisher\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/resizemyimg.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/#organization\",\"name\":\"WebFactory Ltd\",\"url\":\"https:\/\/resizemyimg.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2019\/12\/webfactory_icon.png\",\"contentUrl\":\"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2019\/12\/webfactory_icon.png\",\"width\":300,\"height\":300,\"caption\":\"WebFactory Ltd\"},\"image\":{\"@id\":\"https:\/\/resizemyimg.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webfactoryltd\/\",\"https:\/\/x.com\/webfactoryltd\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/#\/schema\/person\/6b80bbcf3f1d17805d134728bd589c22\",\"name\":\"gordan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/resizemyimg.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1a7e11456b252da6581705039dda5ba3?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1a7e11456b252da6581705039dda5ba3?s=96&d=monsterid&r=g\",\"caption\":\"gordan\"},\"url\":\"https:\/\/resizemyimg.com\/blog\/author\/gordan\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Everything Important to Know About NaN in JavaScript","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:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Everything Important to Know About NaN in JavaScript","og_description":"NaN (Not-a-Number) is a special value in JavaScript that represents an invalid or undefined numerical operation. Understanding NaN is important for writing robust JavaScript code that handles invalid data gracefully. Here, we have explained important things about NaN in JS. Read more","og_url":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/","og_site_name":"Resize my Image Blog","article_publisher":"https:\/\/www.facebook.com\/webfactoryltd\/","article_published_time":"2023-12-08T07:14:09+00:00","article_modified_time":"2024-09-02T22:48:31+00:00","og_image":[{"width":1600,"height":800,"url":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2023\/12\/everything-important-to-know-about-nan-in-javascript.jpg","type":"image\/jpeg"}],"author":"gordan","twitter_card":"summary_large_image","twitter_creator":"@webfactoryltd","twitter_site":"@webfactoryltd","twitter_misc":{"Written by":"gordan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#article","isPartOf":{"@id":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/"},"author":{"name":"gordan","@id":"https:\/\/resizemyimg.com\/blog\/#\/schema\/person\/6b80bbcf3f1d17805d134728bd589c22"},"headline":"Everything Important to Know About NaN in JavaScript","datePublished":"2023-12-08T07:14:09+00:00","dateModified":"2024-09-02T22:48:31+00:00","mainEntityOfPage":{"@id":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/"},"wordCount":643,"publisher":{"@id":"https:\/\/resizemyimg.com\/blog\/#organization"},"image":{"@id":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2023\/12\/everything-important-to-know-about-nan-in-javascript.jpg","keywords":["java","javascript","programming"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/","url":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/","name":"Everything Important to Know About NaN in JavaScript","isPartOf":{"@id":"https:\/\/resizemyimg.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#primaryimage"},"image":{"@id":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2023\/12\/everything-important-to-know-about-nan-in-javascript.jpg","datePublished":"2023-12-08T07:14:09+00:00","dateModified":"2024-09-02T22:48:31+00:00","breadcrumb":{"@id":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#primaryimage","url":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2023\/12\/everything-important-to-know-about-nan-in-javascript.jpg","contentUrl":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2023\/12\/everything-important-to-know-about-nan-in-javascript.jpg","width":1600,"height":800,"caption":"Everything Important to Know About NaN in JavaScript"},{"@type":"BreadcrumbList","@id":"https:\/\/resizemyimg.com\/blog\/everything-important-to-know-about-nan-in-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/resizemyimg.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Everything Important to Know About NaN in JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/resizemyimg.com\/blog\/#website","url":"https:\/\/resizemyimg.com\/blog\/","name":"Resize my Image Blog","description":"News, insights, tips&amp;tricks on image related business &amp; SaaS","publisher":{"@id":"https:\/\/resizemyimg.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/resizemyimg.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/resizemyimg.com\/blog\/#organization","name":"WebFactory Ltd","url":"https:\/\/resizemyimg.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/resizemyimg.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2019\/12\/webfactory_icon.png","contentUrl":"https:\/\/resizemyimg.com\/blog\/wp-content\/uploads\/2019\/12\/webfactory_icon.png","width":300,"height":300,"caption":"WebFactory Ltd"},"image":{"@id":"https:\/\/resizemyimg.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webfactoryltd\/","https:\/\/x.com\/webfactoryltd"]},{"@type":"Person","@id":"https:\/\/resizemyimg.com\/blog\/#\/schema\/person\/6b80bbcf3f1d17805d134728bd589c22","name":"gordan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/resizemyimg.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1a7e11456b252da6581705039dda5ba3?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1a7e11456b252da6581705039dda5ba3?s=96&d=monsterid&r=g","caption":"gordan"},"url":"https:\/\/resizemyimg.com\/blog\/author\/gordan\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/posts\/5282"}],"collection":[{"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/comments?post=5282"}],"version-history":[{"count":1,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/posts\/5282\/revisions"}],"predecessor-version":[{"id":5284,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/posts\/5282\/revisions\/5284"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/media\/5283"}],"wp:attachment":[{"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/media?parent=5282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/categories?post=5282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/resizemyimg.com\/blog\/wp-json\/wp\/v2\/tags?post=5282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}