{"id":6680,"date":"2025-08-01T17:22:47","date_gmt":"2025-08-01T22:22:47","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=6680"},"modified":"2025-08-01T17:23:20","modified_gmt":"2025-08-01T22:23:20","slug":"just-a-semicolon","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/just-a-semicolon\/","title":{"rendered":"Just a Semicolon"},"content":{"rendered":"\n<p>A silly debate that rages just as hard as &#8220;tabs vs spaces&#8221; is &#8220;semicolons or not&#8221; in JavaScript. Generally, the answer is &#8220;use an automatic formatting tool so you don&#8217;t have to think about it&#8221;. But if you happen to be on the &#8220;no semicolons&#8221; side, it&#8217;s interesting to note that it can cause confusing bugs sometimes. <a href=\"https:\/\/blog.tomayac.com\/2025\/07\/26\/what-a-difference-a-semicolon-makes\/\">Thomas Steiner found a fun one<\/a>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-built_in\">console<\/span>.log()\n(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span>(<span class=\"hljs-params\"><\/span>)<\/span>{})<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Just a little log statement followed by an <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Glossary\/IIFE\">IIFE<\/a>, right? Click over to see what actually happens.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A silly debate that rages just as hard as &#8220;tabs vs spaces&#8221; is &#8220;semicolons or not&#8221; in JavaScript. Generally, the answer is &#8220;use an automatic formatting tool so you don&#8217;t have to think about it&#8221;. But if you happen to be on the &#8220;no semicolons&#8221; side, it&#8217;s interesting to note that it can cause confusing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6683,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[3],"class_list":["post-6680","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-the-beat","tag-javascript"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/08\/semicolon.jpg?fit=2000%2C1165&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/6680","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=6680"}],"version-history":[{"count":3,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/6680\/revisions"}],"predecessor-version":[{"id":6685,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/6680\/revisions\/6685"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/6683"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=6680"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=6680"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=6680"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}