<?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: vrezhhakobyan</title>
    <description>The latest articles on DEV Community by vrezhhakobyan (@vrezhhakobyan).</description>
    <link>https://dev.to/vrezhhakobyan</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F926388%2F7e9b1a39-c5dd-4e6c-8cbb-17b3c931180f.png</url>
      <title>DEV Community: vrezhhakobyan</title>
      <link>https://dev.to/vrezhhakobyan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vrezhhakobyan"/>
    <language>en</language>
    <item>
      <title>JavaScript Functions</title>
      <dc:creator>vrezhhakobyan</dc:creator>
      <pubDate>Wed, 09 Nov 2022 21:09:28 +0000</pubDate>
      <link>https://dev.to/vrezhhakobyan/javascript-functions-59dd</link>
      <guid>https://dev.to/vrezhhakobyan/javascript-functions-59dd</guid>
      <description>&lt;p&gt;Functions are little code pieces used to do some tasks and make code shorter and more understandable. For example, it is unnecessary to write the same line of code many times. Instead, you can create a function and tell him how often some task is done. &lt;br&gt;
In JavaScript, to declare a function we use the command&lt;/p&gt;

&lt;p&gt;function   Name(){&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;As you can see, the structure is very simple. You can use any name for your function and in {} write your function.&lt;/p&gt;

&lt;p&gt;function SayHello(){&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; console.log("Hello")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Additionally, you could mention there are () which means that functions can also take some arguments. &lt;/p&gt;

&lt;p&gt;function Sum(a, b){&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; console.log(a+b)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;After creating functions we must call them in our code whenever we want:&lt;/p&gt;

&lt;p&gt;function Sum(a, b){&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; console.log(a+b)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Sum(2,3)&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JavaScript variables</title>
      <dc:creator>vrezhhakobyan</dc:creator>
      <pubDate>Wed, 09 Nov 2022 20:41:29 +0000</pubDate>
      <link>https://dev.to/vrezhhakobyan/javascript-variables-b8a</link>
      <guid>https://dev.to/vrezhhakobyan/javascript-variables-b8a</guid>
      <description>&lt;p&gt;In general, variables play an essential role in programming and solve many questions. As every programming language, JavaScript or JS contains variables. It means that we can create them and give them some value. The values can be different such as numbers, strings, or boolean. But before giving value, we must make the variable. To do that, first, we write the type of variable(var, let, const), which I will explore later. So, for example, we first write: &lt;/p&gt;

&lt;p&gt;var &lt;/p&gt;

&lt;p&gt;Then we have to create a name for that variable. It can be anything but let's call it n. So we have the variable n or:&lt;/p&gt;

&lt;p&gt;var n &lt;/p&gt;

&lt;p&gt;Now we can give some value to our variable. To do that, we put = and then put the value. Let's assume that the value is 5. So we have&lt;/p&gt;

&lt;p&gt;var n = 5&lt;/p&gt;

&lt;p&gt;If we want to give a string value, we must use "" or we will get an error. Additionally, if we write numbers in "", it will no longer be a number. For example:&lt;/p&gt;

&lt;p&gt;var m = "Hello"&lt;/p&gt;

&lt;p&gt;In the same way we can give boolean values:&lt;/p&gt;

&lt;p&gt;var x = true&lt;br&gt;
var y = false&lt;/p&gt;

&lt;p&gt;Now let's talk about the difference between var let and const.&lt;br&gt;
The var and let are approximately the same, and we can change their values during the process. But we can't change the value of const. &lt;/p&gt;

&lt;p&gt;What about scopes.&lt;br&gt;
In JavaScript, scopes are the areas where the variable is visible. In JavaScript, there are 3 types of scopes.&lt;/p&gt;

&lt;p&gt;Block scope&lt;br&gt;
Function scope&lt;br&gt;
Global scope&lt;/p&gt;

&lt;p&gt;Variables in the Block Scopes {} and are accessible only inside that block. For example &lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
   let x = "Hello"&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;If there is a function scope, the situation is the same, we can access to variable only in function. For example:&lt;/p&gt;

&lt;p&gt;function(){&lt;/p&gt;

&lt;p&gt;const n = 10&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Variables in the global scope are visible in everywhere.It means that we can put the variable everywhere and it will work without errors&lt;br&gt;
 For example:&lt;/p&gt;

&lt;p&gt;let a = true&lt;br&gt;
function SayHello()&lt;br&gt;
{&lt;br&gt;
   if(a==true){&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   console.log("Hello")

 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Binary</title>
      <dc:creator>vrezhhakobyan</dc:creator>
      <pubDate>Thu, 15 Sep 2022 18:49:33 +0000</pubDate>
      <link>https://dev.to/vrezhhakobyan/binary-34mk</link>
      <guid>https://dev.to/vrezhhakobyan/binary-34mk</guid>
      <description>&lt;p&gt;Vrezh Hakobyan (AUA)&lt;/p&gt;

&lt;p&gt;As we know, people use standard numbers for their usual tasks. The system of modern numbers is based on ten digits from 0 to 9. This system is simple for humans to understand because we have used it since childhood. Although the ten-based system of numbers is the primary system that people use, it is ununderstandable for computers. Now you can ask why? To answer this question, we need to understand how computers work. Computers only can understand two conditions. These conditions are when the electricity is ON or when it's OFF. So, let's assume that the condition ON is 1 and the condition OFF is 0. Now, we have a system of two numbers called binary. But how can we represent other numbers like 3 , 10 or billion? As you noticed, we have only two digits- 0 and 1. Let's assume that we have a lamp that is turned off. Logically, we can say that it represents the number 0 zero and when we turn it on, it will mean the number 1. Now let's add one more lamp which is turned off. As a result, our first lamp is on, and the second is off. In this case, we can assume that the result of these two combined lamps is 2. This way, we can turn all lamps on to represent the number 3. So, to get the number, we can turn these two lamps on or off and then add new lamps. This principle is used in computers to understand information. From the beginning of the history of computers until now, the binary system has been the only way for people and computers to understand each other. It's possible that people will use other numbering systems in the future to program computers, but the binary system for computers will remain of the greatest inventions in history. &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
