{"id":7322,"date":"2025-11-03T15:52:25","date_gmt":"2025-11-03T15:52:25","guid":{"rendered":"https:\/\/codewithtarun.com\/blog\/?p=7322"},"modified":"2025-11-03T15:52:32","modified_gmt":"2025-11-03T15:52:32","slug":"%f0%9f%a7%a0-the-secret-type-coercion-javascript","status":"publish","type":"post","link":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/","title":{"rendered":"\ud83e\udde0 The Secret: Type Coercion #JavaScript"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1536\" src=\"https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript.jpg\" alt=\"\" class=\"wp-image-7324\" srcset=\"https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript.jpg 1024w, https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript-200x300.jpg 200w, https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript-683x1024.jpg 683w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In many languages like <strong>JavaScript<\/strong>, values can automatically convert (or <em>coerce<\/em>) from one type to another depending on what the operator expects.<\/p>\n\n\n\n<p>When you write <code>\"11\" - 1<\/code>, JavaScript thinks:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u201cSubtraction only makes sense for numbers, so I\u2019ll try to turn the string <code>\"11\"<\/code> into a number.\u201d<\/p>\n<\/blockquote>\n\n\n\n<p>So it converts <code>\"11\"<\/code> \u2192 <code>11<\/code>, and then does:<\/p>\n\n\n\n<p>11 &#8211; 1 = 10<br><br>\u2705 Result: 10<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u2795 But Why <code>\"11\" + 1 = \"111\"<\/code>?<\/h3>\n\n\n\n<p>Now let\u2019s look at the plus sign (<code>+<\/code>).<\/p>\n\n\n\n<p>In JavaScript, <code>+<\/code> is special \u2014 it can mean <strong>addition<\/strong> <em>or<\/em> <strong>string concatenation<\/strong>.<\/p>\n\n\n\n<p>When either side of <code>+<\/code> is a string, JavaScript assumes you\u2019re doing text concatenation, not math.<br>So:<\/p>\n\n\n\n<p>&#8220;11&#8221; + 1 \u2192 &#8220;11&#8221; + &#8220;1&#8221; \u2192 &#8220;111&#8221;<br>\u2705 Result: &#8220;111&#8221;<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>This behavior is not a bug \u2014 it\u2019s part of how JavaScript (and some other weakly typed languages) handle mixed data types.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\udde9 Why Does This Matter?<\/h3>\n\n\n\n<p>This tiny difference can lead to <strong>unexpected bugs<\/strong> in real code. For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const a = \"10\";\nconst b = 5;\n\nconsole.log(a + b); \/\/ \"105\" (Oops!)\nconsole.log(a - b); \/\/ 5     (Wait, what?)\n<\/code><\/pre>\n\n\n\n<p>If you meant to do numeric math, the correct way is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Number(a) + b;  \/\/ 15\n<\/code><\/pre>\n\n\n\n<p>or in modern JavaScript:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>+a + b;  \/\/ 15 (the unary + operator converts to number)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddee What About Other Languages?<\/h3>\n\n\n\n<p>Let\u2019s compare how a few popular languages handle this:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Language<\/th><th><code>\"11\" - 1<\/code><\/th><th><code>\"11\" + 1<\/code><\/th><th>Notes<\/th><\/tr><\/thead><tbody><tr><td><strong>JavaScript<\/strong><\/td><td><code>10<\/code><\/td><td><code>\"111\"<\/code><\/td><td>Implicit type coercion<\/td><\/tr><tr><td><strong>Python<\/strong><\/td><td>\u274c TypeError<\/td><td>\u274c TypeError (unless you convert manually)<\/td><td>Explicit conversion required<\/td><\/tr><tr><td><strong>Java<\/strong><\/td><td>\u274c Compile error<\/td><td><code>\"111\"<\/code> (only with <code>+<\/code> and automatic string conversion)<\/td><td><code>+<\/code> concatenates strings<\/td><\/tr><tr><td><strong>PHP<\/strong><\/td><td><code>10<\/code><\/td><td><code>\"111\"<\/code><\/td><td>Behaves similar to JavaScript<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>So, depending on the language, <code>+<\/code> and <code>-<\/code> can have totally different meanings.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udca1 Key Takeaways<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><code>-<\/code> forces numeric conversion<\/strong> \u2014 <code>\"11\" - 1<\/code> becomes <code>11 - 1<\/code>.<\/li>\n\n\n\n<li><strong><code>+<\/code> favors string concatenation<\/strong> \u2014 <code>\"11\" + 1<\/code> becomes <code>\"11\" + \"1\"<\/code>.<\/li>\n\n\n\n<li>Always <strong>be explicit<\/strong> about conversions to avoid surprises.<\/li>\n\n\n\n<li>When in doubt, use: <code>Number(\"11\") + 1; \/\/ 12 String(11) + 1; \/\/ \"111\"<\/code><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u2728 Final Thought<\/h3>\n\n\n\n<p>This tiny example perfectly shows the beauty and quirks of programming languages.<br>Sometimes, the difference between <code>\"11\" - 1<\/code> and <code>\"11\" + 1<\/code> isn\u2019t about math \u2014 it\u2019s about <strong>how computers think about data<\/strong>.<\/p>\n\n\n\n<p>Understanding these small details makes you a sharper, more intentional coder \u2014 and helps you avoid those \u201cWait, what just happened?\u201d moments!<\/p>\n\n\n\n<p>#JavaScriptTips #SalesforceJavaScriptTips #SalesforceTinyTips #Salesforce <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In many languages like JavaScript, values can automatically convert (or coerce) from one type to another depending on what the operator expects. When you write &#8220;11&#8221; &#8211; 1, JavaScript thinks: &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;\ud83e\udde0 The Secret: Type Coercion #JavaScript&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7322","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\ud83e\udde0 The Secret: Type Coercion #JavaScript - A SalesforceSphere By CodeWithTarun<\/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:\/\/codewithtarun.com\/blog\/2025\/11\/03\/\ud83e\udde0-the-secret-type-coercion-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\ud83e\udde0 The Secret: Type Coercion #JavaScript - A SalesforceSphere By CodeWithTarun\" \/>\n<meta property=\"og:description\" content=\"In many languages like JavaScript, values can automatically convert (or coerce) from one type to another depending on what the operator expects. When you write &quot;11&quot; - 1, JavaScript thinks: &hellip; Read more &quot;\ud83e\udde0 The Secret: Type Coercion #JavaScript&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/\ud83e\udde0-the-secret-type-coercion-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"A SalesforceSphere By CodeWithTarun\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-03T15:52:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-03T15:52:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1536\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Tarun Gupta\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tarun Gupta\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/\"},\"author\":{\"name\":\"Tarun Gupta\",\"@id\":\"https:\/\/codewithtarun.com\/blog\/#\/schema\/person\/cbe8ae2003e574a61d78f6b91c3773d3\"},\"headline\":\"\ud83e\udde0 The Secret: Type Coercion #JavaScript\",\"datePublished\":\"2025-11-03T15:52:25+00:00\",\"dateModified\":\"2025-11-03T15:52:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/\"},\"wordCount\":285,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codewithtarun.com\/blog\/#\/schema\/person\/cbe8ae2003e574a61d78f6b91c3773d3\"},\"image\":{\"@id\":\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript.jpg\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/\",\"url\":\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/\",\"name\":\"\ud83e\udde0 The Secret: Type Coercion #JavaScript - A SalesforceSphere By CodeWithTarun\",\"isPartOf\":{\"@id\":\"https:\/\/codewithtarun.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript.jpg\",\"datePublished\":\"2025-11-03T15:52:25+00:00\",\"dateModified\":\"2025-11-03T15:52:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#primaryimage\",\"url\":\"https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript.jpg\",\"contentUrl\":\"https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript.jpg\",\"width\":1024,\"height\":1536},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codewithtarun.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\ud83e\udde0 The Secret: Type Coercion #JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codewithtarun.com\/blog\/#website\",\"url\":\"https:\/\/codewithtarun.com\/blog\/\",\"name\":\"A SalesforceSphere By CodeWithTarun\",\"description\":\"A Hub for Salesforce Trailblazers &amp; Tech Explorers.\",\"publisher\":{\"@id\":\"https:\/\/codewithtarun.com\/blog\/#\/schema\/person\/cbe8ae2003e574a61d78f6b91c3773d3\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codewithtarun.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/codewithtarun.com\/blog\/#\/schema\/person\/cbe8ae2003e574a61d78f6b91c3773d3\",\"name\":\"Tarun Gupta\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codewithtarun.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/af6262d086f1ed309a700bcf09b2cdf679b126c0abb7cb12797833c3a5f43a97?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/af6262d086f1ed309a700bcf09b2cdf679b126c0abb7cb12797833c3a5f43a97?s=96&d=mm&r=g\",\"caption\":\"Tarun Gupta\"},\"logo\":{\"@id\":\"https:\/\/codewithtarun.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"Salesforce Marketing Champion \ud83c\udfc6 | Founder &amp; CTO, Vivaansh Consulting | Multi-Cloud | DevOps Enthusiast | Public Speaker | Community Leader | MVP Expert | SFMC , Slack | Data Enthusiast\",\"sameAs\":[\"https:\/\/codewithtarun.com\/blog\"],\"url\":\"https:\/\/codewithtarun.com\/blog\/author\/codewtadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\ud83e\udde0 The Secret: Type Coercion #JavaScript - A SalesforceSphere By CodeWithTarun","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:\/\/codewithtarun.com\/blog\/2025\/11\/03\/\ud83e\udde0-the-secret-type-coercion-javascript\/","og_locale":"en_US","og_type":"article","og_title":"\ud83e\udde0 The Secret: Type Coercion #JavaScript - A SalesforceSphere By CodeWithTarun","og_description":"In many languages like JavaScript, values can automatically convert (or coerce) from one type to another depending on what the operator expects. When you write \"11\" - 1, JavaScript thinks: &hellip; Read more \"\ud83e\udde0 The Secret: Type Coercion #JavaScript\"","og_url":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/\ud83e\udde0-the-secret-type-coercion-javascript\/","og_site_name":"A SalesforceSphere By CodeWithTarun","article_published_time":"2025-11-03T15:52:25+00:00","article_modified_time":"2025-11-03T15:52:32+00:00","og_image":[{"width":1024,"height":1536,"url":"https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript.jpg","type":"image\/jpeg"}],"author":"Tarun Gupta","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tarun Gupta","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#article","isPartOf":{"@id":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/"},"author":{"name":"Tarun Gupta","@id":"https:\/\/codewithtarun.com\/blog\/#\/schema\/person\/cbe8ae2003e574a61d78f6b91c3773d3"},"headline":"\ud83e\udde0 The Secret: Type Coercion #JavaScript","datePublished":"2025-11-03T15:52:25+00:00","dateModified":"2025-11-03T15:52:32+00:00","mainEntityOfPage":{"@id":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/"},"wordCount":285,"commentCount":0,"publisher":{"@id":"https:\/\/codewithtarun.com\/blog\/#\/schema\/person\/cbe8ae2003e574a61d78f6b91c3773d3"},"image":{"@id":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript.jpg","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/","url":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/","name":"\ud83e\udde0 The Secret: Type Coercion #JavaScript - A SalesforceSphere By CodeWithTarun","isPartOf":{"@id":"https:\/\/codewithtarun.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#primaryimage"},"image":{"@id":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript.jpg","datePublished":"2025-11-03T15:52:25+00:00","dateModified":"2025-11-03T15:52:32+00:00","breadcrumb":{"@id":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#primaryimage","url":"https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript.jpg","contentUrl":"https:\/\/codewithtarun.com\/blog\/wp-content\/uploads\/2025\/11\/CodeWithTarun_Javascript.jpg","width":1024,"height":1536},{"@type":"BreadcrumbList","@id":"https:\/\/codewithtarun.com\/blog\/2025\/11\/03\/%f0%9f%a7%a0-the-secret-type-coercion-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codewithtarun.com\/blog\/"},{"@type":"ListItem","position":2,"name":"\ud83e\udde0 The Secret: Type Coercion #JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/codewithtarun.com\/blog\/#website","url":"https:\/\/codewithtarun.com\/blog\/","name":"A SalesforceSphere By CodeWithTarun","description":"A Hub for Salesforce Trailblazers &amp; Tech Explorers.","publisher":{"@id":"https:\/\/codewithtarun.com\/blog\/#\/schema\/person\/cbe8ae2003e574a61d78f6b91c3773d3"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codewithtarun.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/codewithtarun.com\/blog\/#\/schema\/person\/cbe8ae2003e574a61d78f6b91c3773d3","name":"Tarun Gupta","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codewithtarun.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/af6262d086f1ed309a700bcf09b2cdf679b126c0abb7cb12797833c3a5f43a97?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/af6262d086f1ed309a700bcf09b2cdf679b126c0abb7cb12797833c3a5f43a97?s=96&d=mm&r=g","caption":"Tarun Gupta"},"logo":{"@id":"https:\/\/codewithtarun.com\/blog\/#\/schema\/person\/image\/"},"description":"Salesforce Marketing Champion \ud83c\udfc6 | Founder &amp; CTO, Vivaansh Consulting | Multi-Cloud | DevOps Enthusiast | Public Speaker | Community Leader | MVP Expert | SFMC , Slack | Data Enthusiast","sameAs":["https:\/\/codewithtarun.com\/blog"],"url":"https:\/\/codewithtarun.com\/blog\/author\/codewtadmin\/"}]}},"featured_media_urls":[],"_links":{"self":[{"href":"https:\/\/codewithtarun.com\/blog\/wp-json\/wp\/v2\/posts\/7322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codewithtarun.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codewithtarun.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codewithtarun.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codewithtarun.com\/blog\/wp-json\/wp\/v2\/comments?post=7322"}],"version-history":[{"count":1,"href":"https:\/\/codewithtarun.com\/blog\/wp-json\/wp\/v2\/posts\/7322\/revisions"}],"predecessor-version":[{"id":7325,"href":"https:\/\/codewithtarun.com\/blog\/wp-json\/wp\/v2\/posts\/7322\/revisions\/7325"}],"wp:attachment":[{"href":"https:\/\/codewithtarun.com\/blog\/wp-json\/wp\/v2\/media?parent=7322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codewithtarun.com\/blog\/wp-json\/wp\/v2\/categories?post=7322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codewithtarun.com\/blog\/wp-json\/wp\/v2\/tags?post=7322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}