{"id":652,"date":"2024-01-02T18:47:00","date_gmt":"2024-01-02T18:47:00","guid":{"rendered":"https:\/\/www.cmsgalaxy.com\/blog\/?p=652"},"modified":"2024-02-05T10:15:05","modified_gmt":"2024-02-05T10:15:05","slug":"javascript-comments","status":"publish","type":"post","link":"https:\/\/www.cmsgalaxy.com\/blog\/javascript-comments\/","title":{"rendered":"JavaScript Comments"},"content":{"rendered":"\n<p>In JavaScript, you can add comments to your code to provide explanations, documentations, or to temporarily disable certain parts of the code without affecting its functionality. There are two main ways to add comments in JavaScript:<\/p>\n\n\n\n<p><strong><em>Single-line comments:<\/em><\/strong> These comments start with <code>\/\/<\/code> and continue until the end of the line. Anything after <strong>\/\/<\/strong> on the same line is considered a comment and is ignored by the JavaScript engine. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"537\" height=\"70\" src=\"https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2024\/02\/image-5.png\" alt=\"\" class=\"wp-image-655\" style=\"width:605px;height:auto\" srcset=\"https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2024\/02\/image-5.png 537w, https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2024\/02\/image-5-300x39.png 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/figure>\n\n\n\n<p><strong><em>Multi-line comments: <\/em><\/strong>These comments start with <code>\/*<\/code> and end with <code>*\/<\/code> .They can span multiple lines and are often used for longer explanations or comments that cover multiple lines of code.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"211\" src=\"https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2024\/02\/image-4.png\" alt=\"\" class=\"wp-image-654\" style=\"width:600px;height:auto\" srcset=\"https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2024\/02\/image-4.png 610w, https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2024\/02\/image-4-300x104.png 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In JavaScript, you can add comments to your code to provide explanations, documentations, or to temporarily disable certain parts of<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"[]"},"categories":[1],"tags":[],"class_list":["post-652","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/posts\/652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/comments?post=652"}],"version-history":[{"count":1,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/posts\/652\/revisions"}],"predecessor-version":[{"id":656,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/posts\/652\/revisions\/656"}],"wp:attachment":[{"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/media?parent=652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/categories?post=652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/tags?post=652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}