{"id":18645,"date":"2020-07-01T10:50:42","date_gmt":"2020-07-01T17:50:42","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=18645"},"modified":"2023-12-01T03:37:56","modified_gmt":"2023-12-01T11:37:56","slug":"javascript-syntax-a-guide-for-beginners","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/","title":{"rendered":"JavaScript Syntax: A Guide for Beginners"},"content":{"rendered":"\n<p>If you\u2019re looking to learn how to write JavaScript, you\u2019ve come to the right place.<br><\/p>\n\n\n\n<p>Every programming language has its own set of rules, just like English. Think about it. When you were in elementary school, you learned the rules of grammar in order to structure sentences.<br><\/p>\n\n\n\n<p>Just like English, programming languages follow rules to make sure everyone can understand what is being said. Imagine if we could all make up our own rules when using English. Nobody would be able to communicate. Similarly, programming languages are strict about rules so that the code you write is able to be executed.<br><\/p>\n\n\n\n<p>In this guide, we\u2019re going to discuss JavaScript syntax. Syntax refers to the set of rules that defines how code is written in JavaScript.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why is Syntax Important?<\/h2>\n\n\n\n<p>In JavaScript, there are some syntax rules you need to follow. For instance, if you don\u2019t close a bracket after you\u2019ve opened one an error will be returned. The computer can\u2019t continue running your program because it doesn\u2019t understand what you are telling it to do.<br><\/p>\n\n\n\n<p>This merits an important distinction between computers and humans: whereas humans may be able to identify the occasional error and skip past it, computers cannot do the same when running code in any programming language. That\u2019s why it\u2019s important you write code using the syntax of the programming language you are working with.<br><\/p>\n\n\n\n<p>Syntax also makes your code more readable. When everyone is using the same syntax, it\u2019s easy to interpret other people\u2019s programs. Just like in English, once you know the basic rules, there\u2019s no line of code you cannot read.<br><\/p>\n\n\n\n<p>In this guide, we\u2019re going to focus on the following features of syntax:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Whitespace<\/li>\n\n\n\n<li>Naming Variables<\/li>\n\n\n\n<li>Indentation<\/li>\n\n\n\n<li>Comments<\/li>\n\n\n\n<li>Semicolons<\/li>\n<\/ul>\n\n\n\n<p>Let\u2019s begin!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Whitespace<\/h2>\n\n\n\n<p>Programmers debate whitespace over and over again. It\u2019s a very controversial topic. Setting aside those debates for a minute, there\u2019s one key rule you need to remember when it comes to syntax in JavaScript: you should have spaces between variables, and before and after parenthesis.<br><\/p>\n\n\n\n<p>Let\u2019s say you are writing a <code>for<\/code> loop:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>for (var i = 0; i &lt; 4; i++) {\n\tconsole.log(i);\n}\n<\/pre><\/div>\n\n\n\n<p>This loop prints out all numbers between the range of 0 to 4 to the console. As you can see, there\u2019s a space between our <code>for<\/code> key and the opening bracket of our <code>for<\/code> loop. There\u2019s a space between our closing curly bracket (() and our opening curly brace ({). There\u2019s also a space between all of the statements in these brackets:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>var i = 0;<\/li>\n\n\n\n<li>i &lt; 4;<\/li>\n<\/ul>\n\n\n\n<p>When you\u2019re assigning a variable outside a <code>for<\/code> loop, you\u2019d use the same approach:<br><\/p>\n\n\n\n<p><code>var cookie = \u201cRaspberry Chocolate Chip\u201d;<br><\/code><\/p>\n\n\n\n<p>Adding spaces between your variables makes it easy to read your code.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Indentation<\/h2>\n\n\n\n<p>Unlike other programming languages, you can write a JavaScript program on one line. It\u2019s not a good idea \u2013 think about how hard it would be to read your code \u2013 but you can still do it.<br><\/p>\n\n\n\n<p>Every statement that\u2019s within a code block \u2013 such as an <code>if<\/code> conditional statement or a class \u2013 should be indented. Indentation refers to adding either two spaces, four spaces or a tab at the start of your code. There\u2019s a lot of debate among programmers about what is best, but as long as you maintain consistency across your code, you\u2019ll have no trouble.<br><\/p>\n\n\n\n<p>Here\u2019s an indented <code>for<\/code> loop:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>for (var i = 0; i &lt; 4; i++) {\n\tconsole.log(i);\n}\n<\/pre><\/div>\n\n\n\n<p>You can see the term <code>console.log()<\/code> was indented using a tab. That\u2019s because it is contained within our curly braces. This helps distinguish the contents of our for loop with the rest of our code. If we had another code block in our code, such as an <code>if<\/code> statement, we\u2019d indent its contents even more:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>for (var i = 0; i &lt; 4; i++) {\n\tif (i === 3) {\n\t\tconsole.log(i);\n\t}\n}\n<\/pre><\/div>\n\n\n\n<p>This code prints out the value of <code>i<\/code> if it is equal to three. Otherwise, nothing happens. In this snippet, our <code>if<\/code> statement is indented by one tab because it\u2019s on our <code>for<\/code> loop. Our <code>console.log()<\/code> statement is indented by two tabs because it is contained within our <code>if<\/code> statement, which itself is contained within our <code>for<\/code> statement.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Comments<\/h2>\n\n\n\n<p>Comments are statements written by developers, for developers. They are technically read by JavaScript, but they will not be executed.<br><\/p>\n\n\n\n<p>The purpose of comments is to help developers keep track of their code. If you\u2019re implementing a complex function, you may want to write a few comments so you know what each part of the function does. Comments are often used in collaborative projects as well so that every developer can understand a program, even if they\u2019ve not written it themselves.<br><\/p>\n\n\n\n<p>In JavaScript, comments are written using double slashes, followed by the comment:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>\/\/ This is a comment that will be skipped over by JavaScript!\n<\/pre><\/div>\n\n\n\n<p>All subsequent characters after the double slashes are treated as a comment. To make a comment span multiple lines, you can use this syntax:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>\/* This is a comment\nthat spans multiple lines. *\/\n<\/pre><\/div>\n\n\n\n<p>Any text between \/* and *\/ will be ignored by the JavaScript compiler.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Naming Variables<\/h2>\n\n\n\n<p>There\u2019s a lot of different ways you can name a variable. The three most popular methods are using upper camel case, lower camel case and underscores.<br><\/p>\n\n\n\n<p>In JavaScript, most developers prefer to use lower camel case to name variables:<br><\/p>\n\n\n\n<p><code>firstName, surname, isAdmin<br><\/code><\/p>\n\n\n\n<p>Declaring variables in JavaScript looks like this:<br><\/p>\n\n\n\n<p><code>var firstName = \u201cTony\u201d;<br><\/code><\/p>\n\n\n\n<p>The type of variable you are using (in this case var) is followed by the name of the variable, then an equal sign, then the value you want to store in the variable.<br><\/p>\n\n\n\n<p>The first word in a variable should begin with a lowercase letter, even if the variable only includes one word. The second word and all subsequent words should begin with an upper case letter, as you can see above.<br><\/p>\n\n\n\n<p>While you can write variables using other methods (like \u201cfirst_name\u201d in underscores or \u201cFirstName\u201d in upper camel case), it\u2019s not as common to do so in JavaScript.<br><\/p>\n\n\n\n<p>Variables in JavaScript are case sensitive. This means that <code>firstName<\/code> and <code>firstname<\/code>, while containing the same basic characters, would be treated differently.<br><\/p>\n\n\n\n<p>There are a few words called \u201creserved words\u201d that you can\u2019t use as variable names. These are words that have a special function in JavaScript. For instance, you can\u2019t name a variable \u201cclass\u201d or \u201cfor\u201d, because these are already used in the language.<br><\/p>\n\n\n\n<p>You can find a list of reserved JavaScript keywords on the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Lexical_grammar#Reserved_keywords_as_of_ECMAScript_2015\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\">Mozilla Developer Network<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Semicolons<\/h2>\n\n\n\n<p>In English, every sentence ends with a period; a full stop. This tells us when to stop reading one sentence and begin another. If you think back to your elementary school days, you were probably told that sentences were a place to pause and take a breath.<br><\/p>\n\n\n\n<p>Computer programs don\u2019t need to take a breath, but they do need to know how statements are split up in a program. In JavaScript, most statements end with a semicolon:<br><\/p>\n\n\n\n<p><code>var cookie = \u201cChocolate Fudge\u201d;<br><\/code><\/p>\n\n\n\n<p>You don\u2019t need to specify a semicolon after any block statement. These are statements like class, switch, do, if and for. These statements use curly brackets to store their code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>function addNumbers(one, two) {\n\treturn one + two;\n}\n<\/pre><\/div>\n\n\n\n<p>In this code, you can see that we ended our <code>return<\/code> statement with a semicolon. That\u2019s because it is in our function. Our function does not end with a semicolon.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>There are a lot of rules in the JavaScript programming language. Each of these rules ensures that you write code both you and the browser can read. If you\u2019re working on a team, it\u2019s especially important to adhere to the syntax rules of JavaScript.<br><\/p>\n\n\n\n<p>Here\u2019s a recap of the main rules we have covered:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>All statements in a variable declaration or after a keyword like \u201cfor\u201d or \u201cif\u201d should be separated by a whitespace.<\/li>\n\n\n\n<li>Statements enclosed within a block of code (i.e. \u201cif\u201d, \u201celse\u201d) should be indented.<\/li>\n\n\n\n<li>Variable names should use lower camel case and should not be equal to any reserved keyword.<\/li>\n\n\n\n<li>Every statement, aside from block statements, should end in a semicolon.<\/li>\n\n\n\n<li>\/\/ can be used to write a single-line comment and \/* *\/ can be used to write a comment that spans multiple lines.<\/li>\n<\/ul>\n\n\n\n<p>Now you\u2019re ready to start coding in JavaScript like a professional developer!<br><\/p>\n","protected":false},"excerpt":{"rendered":"If you\u2019re looking to learn how to write JavaScript, you\u2019ve come to the right place. Every programming language has its own set of rules, just like English. Think about it. When you were in elementary school, you learned the rules of grammar in order to structure sentences. Just like English, programming languages follow rules to&hellip;","protected":false},"author":240,"featured_media":18802,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[],"class_list":{"0":"post-18645","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-javascript"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"JavaScript","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":"","is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>JavaScript Syntax: A Guide for Beginners | Career Karma<\/title>\n<meta name=\"description\" content=\"Like any programming language, JavaScript has a set of rules you have to follow. On Career Karma, learn about some of the top syntactic rules in JavaScript.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Syntax: A Guide for Beginners\" \/>\n<meta property=\"og:description\" content=\"Like any programming language, JavaScript has a set of rules you have to follow. On Career Karma, learn about some of the top syntactic rules in JavaScript.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-01T17:50:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:37:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dMUt0X3f59Q-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"800\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"JavaScript Syntax: A Guide for Beginners\",\"datePublished\":\"2020-07-01T17:50:42+00:00\",\"dateModified\":\"2023-12-01T11:37:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/\"},\"wordCount\":1321,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dMUt0X3f59Q-unsplash.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/\",\"name\":\"JavaScript Syntax: A Guide for Beginners | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dMUt0X3f59Q-unsplash.jpg\",\"datePublished\":\"2020-07-01T17:50:42+00:00\",\"dateModified\":\"2023-12-01T11:37:56+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Like any programming language, JavaScript has a set of rules you have to follow. On Career Karma, learn about some of the top syntactic rules in JavaScript.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dMUt0X3f59Q-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dMUt0X3f59Q-unsplash.jpg\",\"width\":1000,\"height\":800},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/careerkarma.com\/blog\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript Syntax: A Guide for Beginners\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"JavaScript Syntax: A Guide for Beginners | Career Karma","description":"Like any programming language, JavaScript has a set of rules you have to follow. On Career Karma, learn about some of the top syntactic rules 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:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Syntax: A Guide for Beginners","og_description":"Like any programming language, JavaScript has a set of rules you have to follow. On Career Karma, learn about some of the top syntactic rules in JavaScript.","og_url":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-07-01T17:50:42+00:00","article_modified_time":"2023-12-01T11:37:56+00:00","og_image":[{"width":1000,"height":800,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dMUt0X3f59Q-unsplash.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"JavaScript Syntax: A Guide for Beginners","datePublished":"2020-07-01T17:50:42+00:00","dateModified":"2023-12-01T11:37:56+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/"},"wordCount":1321,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dMUt0X3f59Q-unsplash.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/","url":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/","name":"JavaScript Syntax: A Guide for Beginners | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dMUt0X3f59Q-unsplash.jpg","datePublished":"2020-07-01T17:50:42+00:00","dateModified":"2023-12-01T11:37:56+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Like any programming language, JavaScript has a set of rules you have to follow. On Career Karma, learn about some of the top syntactic rules in JavaScript.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dMUt0X3f59Q-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dMUt0X3f59Q-unsplash.jpg","width":1000,"height":800},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/javascript-syntax-a-guide-for-beginners\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/careerkarma.com\/blog\/javascript\/"},{"@type":"ListItem","position":3,"name":"JavaScript Syntax: A Guide for Beginners"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/18645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=18645"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/18645\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/18802"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=18645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=18645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=18645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}