{"id":1604,"date":"2012-10-14T22:25:51","date_gmt":"2012-10-15T02:25:51","guid":{"rendered":"http:\/\/www.rexfeng.com\/blog\/?p=1604"},"modified":"2012-10-14T22:25:51","modified_gmt":"2012-10-15T02:25:51","slug":"10-tips-for-javascript-beginners","status":"publish","type":"post","link":"https:\/\/www.rexfeng.com\/blog\/2012\/10\/10-tips-for-javascript-beginners\/","title":{"rendered":"10 Tips for JavaScript Beginners"},"content":{"rendered":"<p>This JavaScript 101 post is based on the presentation <a href=\"https:\/\/speakerdeck.com\/u\/ynonperek\/p\/javascript-syntax\">JavaScript Syntax by Ynon Perek<\/a>.<\/p>\n<div id=\"attachment_1605\" style=\"width: 550px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.flickr.com\/photos\/85763206@N00\/2945260782\/\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1605\" class=\"size-large wp-image-1605\" title=\"Puzzle pieces\" src=\"http:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2012\/10\/2945260782_b98bf8d597_z-540x360.jpg\" alt=\"Puzzle pieces By liza31337\" width=\"540\" height=\"360\" srcset=\"https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2012\/10\/2945260782_b98bf8d597_z-540x360.jpg 540w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2012\/10\/2945260782_b98bf8d597_z-150x100.jpg 150w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2012\/10\/2945260782_b98bf8d597_z-300x200.jpg 300w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2012\/10\/2945260782_b98bf8d597_z-624x416.jpg 624w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2012\/10\/2945260782_b98bf8d597_z.jpg 640w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/a><p id=\"caption-attachment-1605\" class=\"wp-caption-text\">Puzzle pieces By liza31337<\/p><\/div>\n<p><a href=\"http:\/\/ynonperek.com\/\">Ynon<\/a>&#8216;s slides do a great job covering key JavaScript fundamentals:<\/p>\n<p><span style=\"line-height: 24px;\"><strong>Values<\/strong><br \/>\n<\/span>1. Undefined refers to anything that hasn&#8217;t been assigned a value.<br \/>\n2. In JS, false is made up of <em>false, null, unidentified, &#8220;&#8221;, 0<\/em>, and <em>NaN<\/em>.<br \/>\n3. Everything else is truthy in JS.<\/p>\n<p><strong>Naming Conventions<\/strong><br \/>\n4. Identifiers start with <em>letters, _,<\/em> or <em>$<\/em>. They are followed by\u00a0<em>letters, digits, _, <\/em>or<em> $.<\/em><br \/>\n5. Variable names are lowercased, with words split by _. Function names are CamelCased.<\/p>\n<p><strong>Variables<\/strong><br \/>\n6. JavaScript has function scope.<br \/>\n7. Outside of functions, any variables defined have global scope and\u00a0is accessible anywhere in the application.<\/p>\n<p><strong>Objects<\/strong><br \/>\n8. Objects are a collection of key, value pairs.<br \/>\n9. Functions are normal JS objects.<br \/>\n10. function foo() {} is equivalent to var foo = function() {};<\/p>\n<p><a href=\"http:\/\/en.wikipedia.org\/wiki\/JavaScript\">JavaScript<\/a> and <a href=\"http:\/\/jquery.com\/\">JQuery<\/a> are powerful tools for implementing web page user interaction. The best way to get started is to try writing some JavaScript and look up anything that you&#8217;re not sure about.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This JavaScript 101 post is based on the presentation JavaScript Syntax by Ynon Perek. Ynon&#8216;s slides do a great job covering key JavaScript fundamentals: Values 1. Undefined refers to anything that hasn&#8217;t been assigned a value. 2. In JS, false is made up of false, null, unidentified, &#8220;&#8221;, 0, and NaN. 3. Everything else is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1029],"tags":[],"class_list":["post-1604","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/1604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/comments?post=1604"}],"version-history":[{"count":3,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/1604\/revisions"}],"predecessor-version":[{"id":1608,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/1604\/revisions\/1608"}],"wp:attachment":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/media?parent=1604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/categories?post=1604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/tags?post=1604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}