<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Oloyede Adeosun </title>
    <description>The latest articles on DEV Community by Oloyede Adeosun  (@adesleem).</description>
    <link>https://dev.to/adesleem</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F674892%2F5938f6ad-c58c-4de9-ac2a-40f415b44551.png</url>
      <title>DEV Community: Oloyede Adeosun </title>
      <link>https://dev.to/adesleem</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adesleem"/>
    <language>en</language>
    <item>
      <title>How to use JavaScript Comments</title>
      <dc:creator>Oloyede Adeosun </dc:creator>
      <pubDate>Sat, 08 Jan 2022 23:33:45 +0000</pubDate>
      <link>https://dev.to/adesleem/how-to-use-javascript-comments-nf0</link>
      <guid>https://dev.to/adesleem/how-to-use-javascript-comments-nf0</guid>
      <description>&lt;h2&gt;
  
  
  Fun Facts About Javascript
&lt;/h2&gt;

&lt;p&gt;Brendan Eich created JavaScript in 1995, and it became an ECMA standard in 1997. The standard's official name is ECMA-262. The language's official name is ECMAScript. &lt;/p&gt;

&lt;p&gt;In this post, I will be looking at comments and how they are used in javascript. Lets get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  What are comments in javaScript
&lt;/h2&gt;

&lt;p&gt;In JavaScript, comments are used to provide annotations to your code to help anyone trying to read it understand it. They can also be used to deactivate sections of code without deleting them. &lt;/p&gt;

&lt;p&gt;Comments are made by putting // before a single line or /* before and */ after several lines of codes.A variety of computer languages include the ability to comment on code as a standard feature. &lt;/p&gt;

&lt;h2&gt;
  
  
  Single Line Comment
&lt;/h2&gt;

&lt;p&gt;Single-line comments in javascript are used to comment a portion of a line or a whole line of code. You can use it to either explain or debug the code (commenting out to stop the browser from reading the executing the line of code).  I've provided an example of a before and after commenting out a line of code below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K0-CiSjy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kpk0iqsk9y1t2pdoxzw1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K0-CiSjy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kpk0iqsk9y1t2pdoxzw1.png" alt="Before comment" width="880" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--82emj9P0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ggj7wvv0wxsajk7o8qia.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--82emj9P0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ggj7wvv0wxsajk7o8qia.png" alt="After comment" width="880" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To comment out a line of code on Mac: &lt;br&gt;
Select the line of code&lt;br&gt;
On your keyboard, press the command and / keys together &lt;br&gt;
Its the same on windows, the only difference is instead of command button it will be control on windows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-Line Comment
&lt;/h2&gt;

&lt;p&gt;Comments that span multiple lines begin with /* and conclude with /. JavaScript will ignore any text between /* and */. To clarify the code, the example below uses a multi-line remark: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FHB6_JUu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ybfab8ti116m7uuit0z1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FHB6_JUu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ybfab8ti116m7uuit0z1.png" alt="Multi-Line comment" width="880" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How To Link JavaScript To Your Project</title>
      <dc:creator>Oloyede Adeosun </dc:creator>
      <pubDate>Wed, 29 Dec 2021 14:55:27 +0000</pubDate>
      <link>https://dev.to/adesleem/javascript-basics-linking-javascript-to-your-project-53mc</link>
      <guid>https://dev.to/adesleem/javascript-basics-linking-javascript-to-your-project-53mc</guid>
      <description>&lt;p&gt;JavaScript is the world's most popular programming language according to &lt;a href="https://insights.stackoverflow.com/survey/2021#most-popular-technologies-language"&gt;stackoverflow survey 2021&lt;/a&gt;. As far as I know, its also the only programming language for front-end development for this reason its in very high demand and if you are looking to get into web development a must have skill as at the time of this post. &lt;/p&gt;

&lt;p&gt;In this post, I will be showing you different ways you can link javascript to your projects. I'm assuming you are already familiar with HTM &amp;amp; CSS.  Lets get started!&lt;br&gt;
What We will Cover&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Overview&lt;/li&gt;
&lt;li&gt;Inline javascript&lt;/li&gt;
&lt;li&gt;Internal javascript&lt;/li&gt;
&lt;li&gt;External javascript&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Overview
&lt;/h4&gt;

&lt;p&gt;In order to ensure your programme works as expected, it needs to be linked with the root of your project i.e the root HTML. There are a few ways to accomplish this. In this post we will be focusing mainly on 3 ways (inline, internal &amp;amp; external).&lt;/p&gt;

&lt;h4&gt;
  
  
  Inline Javascript
&lt;/h4&gt;

&lt;p&gt;This is simply javascript code written in between the opening  bracket of a html element. See sample syntax below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jl0JuPnR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s10imd0aatlqcm22s1dq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jl0JuPnR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s10imd0aatlqcm22s1dq.png" alt="Image description" width="880" height="164"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Internal Javascript
&lt;/h4&gt;

&lt;p&gt;This is javascript written in between a script tag within the html file. This is can be added to the html head but we will stick with the tag being placed just above the body closing tag. Sample syntax blow:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5A1TEu_n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/57al97yqdpf7igx0hqmk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5A1TEu_n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/57al97yqdpf7igx0hqmk.png" alt="Image description" width="880" height="595"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This snippet shows a simple programme that tells the buttons to alert ' This is internal script' to the browser once clicked. Notice that the button elements are above the script tag and they are all (button and script) within the html body tag. &lt;/p&gt;

&lt;h4&gt;
  
  
  External Javascript
&lt;/h4&gt;

&lt;p&gt;Before we dive into external  javascript let me inform you that all javascript files must have .js extension just like .html &amp;amp; .css, the file can be named anything you like it just must have the extension .js, see example below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PTLZRlDL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fmq9ihzkwzmq572uxp26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PTLZRlDL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fmq9ihzkwzmq572uxp26.png" alt="Image description" width="234" height="32"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next question is how does external javascript work and I can tell you that it is what it says on the tin. This is a way to connect javascript to your project with an external js file. This is particularly practical when you are building a project with multiple pages. &lt;/p&gt;

&lt;p&gt;In order to achieve this you will need to use the script tag  but this time you will need to add the source attribute, within the source (src) you will need add the path to the js file just like below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QXK47jUw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k9wrda49j1tsrybmrz9r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QXK47jUw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k9wrda49j1tsrybmrz9r.png" alt="Image description" width="880" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Summary
&lt;/h4&gt;

&lt;p&gt;At the end of the day, its upto you how you want to link javascript to your project. However, you will need to consider how scalable the method you choose will be for your project. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
