<?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: Arman</title>
    <description>The latest articles on DEV Community by Arman (@tiarman).</description>
    <link>https://dev.to/tiarman</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%2F626683%2F95917c8d-1669-44b6-bd6b-fd1159b2cc19.png</url>
      <title>DEV Community: Arman</title>
      <link>https://dev.to/tiarman</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tiarman"/>
    <language>en</language>
    <item>
      <title>Notice</title>
      <dc:creator>Arman</dc:creator>
      <pubDate>Tue, 01 Jun 2021 03:19:31 +0000</pubDate>
      <link>https://dev.to/tiarman/notice-2ncl</link>
      <guid>https://dev.to/tiarman/notice-2ncl</guid>
      <description>&lt;p&gt;To           All employees&lt;br&gt;
From         Desiree Yeung&lt;br&gt;
Date         Oct. 27, 2030&lt;br&gt;
Subject      Annual Physical Exam&lt;/p&gt;

&lt;p&gt;Please note that the annual physical exam will be held inside the company office instead of a satellite clinic. This is to ensure the safety and security of everyone in Quicklight Pharmaceuticals.&lt;/p&gt;

&lt;p&gt;Services will start at 7 AM. Please bring both HMO and company ID and fill up the digital registration form that will be sent to your email accounts.&lt;/p&gt;

&lt;p&gt;189 49th Avenue&lt;br&gt;
Grise Fiord, NU X0A 0J0&lt;br&gt;
&lt;a href="http://www.reallygreatsite.com"&gt;www.reallygreatsite.com&lt;/a&gt;&lt;br&gt;
(098) 765-4321&lt;/p&gt;

</description>
    </item>
    <item>
      <title>official Notice</title>
      <dc:creator>Arman</dc:creator>
      <pubDate>Tue, 01 Jun 2021 03:15:04 +0000</pubDate>
      <link>https://dev.to/tiarman/official-notice-2422</link>
      <guid>https://dev.to/tiarman/official-notice-2422</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;To          Marketing Staff&lt;br&gt;
From        Desiree Yeung&lt;br&gt;
Date        Oct. 27, 2030&lt;br&gt;
Subject     Social Media Branding&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;The company has gone through significant growth in the past few months. As such, a few of our campaigns for the upcoming year needs to be reviewed and re-aligned.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;One area that we want to focus on is the company's social media branding. While we have a strong following and a distinct brand identity, we want to be able to grow that and stay relevant for far longer.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;The meeting with the  marketing staff aims to hear ideas and suggestions on how we can move to this direction.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;The meeting will be on November 5, 10 AM, Seelie Hall.&lt;/code&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;DLY Urban Club&lt;br&gt;
123 Anywhere St., Any City ST 12345&lt;br&gt;
&lt;a href="mailto:hello@reallygreatsite.com"&gt;hello@reallygreatsite.com&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Memo</title>
      <dc:creator>Arman</dc:creator>
      <pubDate>Tue, 01 Jun 2021 03:09:15 +0000</pubDate>
      <link>https://dev.to/tiarman/memo-1b5c</link>
      <guid>https://dev.to/tiarman/memo-1b5c</guid>
      <description>&lt;p&gt;To          All employees&lt;br&gt;
From        Ndemi Otieno&lt;br&gt;
Date        23 November 2030&lt;br&gt;
Subject     Bank account change&lt;/p&gt;

&lt;p&gt;Team,&lt;/p&gt;

&lt;p&gt;Please be informed that the company will be changing its bank from Golden Ore Bank to Zenith Central Bank.&lt;/p&gt;

&lt;p&gt;You will receive an email from finance within the week to facilitate this change. Please fill out the forms before 25 November 2030 so we can process the application for you. Any submission after that will have to be facilitated by the employee personally.&lt;/p&gt;

&lt;p&gt;Please don't hesitate to reach out if you have any questions.&lt;/p&gt;

&lt;p&gt;Sincerely,&lt;/p&gt;

&lt;p&gt;Ndemi Otieno&lt;br&gt;
Head of Human Resources&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                                            2507 Snowbird Lane
                                            Bellevue, NE 68005
                                       www.reallygreatsite.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
    <item>
      <title>Official Memo</title>
      <dc:creator>Arman</dc:creator>
      <pubDate>Tue, 01 Jun 2021 03:03:46 +0000</pubDate>
      <link>https://dev.to/tiarman/official-memo-3nm1</link>
      <guid>https://dev.to/tiarman/official-memo-3nm1</guid>
      <description>&lt;p&gt;TO         UX/UI Team&lt;br&gt;
From       Cia Rodriguez&lt;br&gt;
Date       November 28, 2020&lt;br&gt;
Subject    Updated Work from Home Guidelines&lt;/p&gt;

&lt;p&gt;Due to the increasing number of infected cases in the city, we are extending our Work from Home setup until further notice.&lt;/p&gt;

&lt;p&gt;Please reach out to our office facilities if you need any of equipment from the office. We can arrange a delivery for you in the soonest possible time.&lt;/p&gt;

&lt;p&gt;We are on flexi-time, but please ensure you are online and on time for meetings. Coordinate with your teams to create timelines especially if you have projects that are urgent.&lt;/p&gt;

&lt;p&gt;We are here for you. Stay safe.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JavaScript Keys</title>
      <dc:creator>Arman</dc:creator>
      <pubDate>Sun, 09 May 2021 05:12:32 +0000</pubDate>
      <link>https://dev.to/tiarman/javascript-keys-b34</link>
      <guid>https://dev.to/tiarman/javascript-keys-b34</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;What is JavaScript?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;JavaScript is a very powerful client-side scripting language. JavaScript is used mainly for enhancing the interaction of a user with the webpage. In other words, you can make your webpage more lively and interactive, with the help of JavaScript. JavaScript is also being used widely in game development and Mobile application development.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--82BPxxw0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wl082jwunnat0wkpz9ih.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--82BPxxw0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wl082jwunnat0wkpz9ih.png" alt="Example2"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x;
x = 1;   // x is a number
x = '1'; // x is a string
x = [1]; // x is an array
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Seemingly different values equate to &lt;code&gt;true&lt;/code&gt; when compared with &lt;code&gt;==&lt;/code&gt; (loose or abstract equality) because JavaScript (effectively) converts each to a string representation before comparison:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// all true
1 == '1';
1 == [1];
'1' == [1];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A more obvious &lt;code&gt;false&lt;/code&gt; result occurs when comparing with &lt;code&gt;===&lt;/code&gt; (strict equality) because the type is considered:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// all false
1 === '1';
1 === [1];
'1' === [1];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Internally, JavaScript sets a value to one of six primitive data types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Undefined (a variable with no defined value)&lt;/li&gt;
&lt;li&gt;Null (a single null value)&lt;/li&gt;
&lt;li&gt;Boolean (true or false)&lt;/li&gt;
&lt;li&gt;Number (this includes &lt;code&gt;Infinity&lt;/code&gt; and &lt;code&gt;NaN&lt;/code&gt; – not a number!)&lt;/li&gt;
&lt;li&gt;String (textual data)&lt;/li&gt;
&lt;li&gt;Symbol (a unique and immutable primitive new to ES6/2015)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything else is an Object — including arrays.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Truthy and Falsy&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;As well as a type, each value also has an inherent boolean value, generally known as either truthy or falsy. Some of the rules are a little bizarre so understanding the concepts and effect on comparison helps when debugging JavaScript applications.&lt;/p&gt;

&lt;p&gt;The following values are &lt;strong&gt;always falsy&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;false&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;0&lt;/code&gt; (zero)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;''&lt;/code&gt; or &lt;code&gt;""&lt;/code&gt; (empty string)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;null&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;undefined&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;NaN&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything else is &lt;strong&gt;truthy&lt;/strong&gt;. That includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;'0'&lt;/code&gt; (a string containing a single zero)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;'false'&lt;/code&gt; (a string containing the text “false”)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[]&lt;/code&gt; (an empty array)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{}&lt;/code&gt; (an empty object)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;function(){}&lt;/code&gt; (an “empty” function)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A single value can therefore be used within conditions, e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (value) {
  // value is truthy
}
else {
  // value is falsy
  // it could be false, 0, '', null, undefined or NaN
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Loose Equality Comparisons With &lt;code&gt;==&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;false&lt;/code&gt;, zero and empty strings are all equivalent.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;null&lt;/code&gt; and &lt;code&gt;undefined&lt;/code&gt; are equivalent to themselves and each other but nothing else.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;NaN&lt;/code&gt; is not equivalent to anything – including another &lt;code&gt;NaN&lt;/code&gt;!&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Infinity&lt;/code&gt; is truthy – but cannot be compared to &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;!&lt;/li&gt;
&lt;li&gt;An empty array is truthy – yet comparing with &lt;code&gt;true&lt;/code&gt; is &lt;code&gt;false&lt;/code&gt; and comparing with false is true?!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// all true
false == 0;
0 == '';
null == undefined;
[] == false;
!![0] == true;

// all false
false == null;
NaN == NaN;
Infinity == true;
[] == true;
[0] == true;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Strict Equality Comparisons With &lt;code&gt;===&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The situation is clearer when using a strict comparison because the value types must match:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z8iS2haM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f8xukhdcfh8ruiohfisn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z8iS2haM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f8xukhdcfh8ruiohfisn.PNG" alt="Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The only exception is &lt;code&gt;NaN&lt;/code&gt; which remains stubbornly inequivalent to everything.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Recommendations&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Truthy and falsy values can catch out the most experienced developers. Those new to programming or migrating from other languages have no chance! Fortunately, there are simple steps to catch the most difficult-to-spot errors when handling truthy and falsy variables:&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;1. Avoid direct comparisons&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;It’s rarely necessary to compare two truthy and falsy values when a single value will always equate to true or false:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// instead of
if (x == false) // ...
// runs if x is false, 0, '', or []

// use
if (!x) // ...
// runs if x is false, 0, '', NaN, null or undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;2. Use &lt;code&gt;===&lt;/code&gt; strict equality&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Use a &lt;code&gt;===&lt;/code&gt; strict equality (or &lt;code&gt;!==&lt;/code&gt; strict inequality) comparisons to compare values and avoid type conversion issues:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// instead of
if (x == y) // ...
// runs if x and y are both truthy or both falsy
// e.g. x = null and y = undefined

// use
if (x === y) // ...
// runs if x and y are identical...
// except when both are NaN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;What is Scope?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Scope determines the visibility or accessibility of a variable or other resource in the area of your code.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Global Scope&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;There's only one Global scope in the JavaScript document. The area outside all the functions is consider the global scope and the variables defined inside the global scope can be accessed and altered in any other scopes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//global scope
var fruit = 'apple'
console.log(fruit);        //apple

function getFruit(){
    console.log(fruit);    //fruit is accessible here
}

getFruit();                //apple
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Local Scope&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Variables declared inside the functions become &lt;code&gt;Local&lt;/code&gt; to the function and are considered in the corresponding local scope. Every Functions has its own scope. Same variable can be used in different functions because they are bound to the respective functions and are not mutual visible.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//global scope
function foo1(){
    //local scope 1
    function foo2(){
        //local scope 2
    }
}

//global scope
function foo3(){
    //local scope 3
}

//global scope
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Local scope can be divided into function scope and block scope. The concept of block scope is introduced in ECMA script 6 (ES6) together with the new ways to declare variables -- const and let.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Function Scope&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Whenever you declare a variable in a function, the variable is visible only within the function. You can't access it outside the function. var is the keyword to define variable for a function-scope accessibility.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function foo(){
    var fruit ='apple';
    console.log('inside function: ',fruit);
}

foo();                    //inside function: apple
console.log(fruit);       //error: fruit is not defined 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Block Scope&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A block scope is the area within if, switch conditions or for and while loops. Generally speaking, whenever you see {curly brackets}, it is a block. In ES6, const and let keywords allow developers to declare variables in the block scope, which means those variables exist only within the corresponding block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function foo(){
    if(true){
        var fruit1 = 'apple';        //exist in function scope
        const fruit2 = 'banana';     //exist in block scope
        let fruit3 = 'strawberry';   //exist in block scope

    }
    console.log(fruit1);
    console.log(fruit2);
    console.log(fruit3);
}

foo();
//result:
//apple
//error: fruit2 is not defined
//error: fruit3 is not defined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Lexical Scope&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Another point to mention is the lexical scope. Lexical scope means the children scope have the access to the variables defined in the parent scope. The children functions are lexically bound to the execution context of their parents.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function foo1(){
    var fruit1 = 'apple';        
    const fruit2 = 'banana';     
    let fruit3 = 'strawberry';
    function foo2(){
        console.log(fruit1);
        console.log(fruit2);
        console.log(fruit3);
    }
    foo2();
}

foo1();

//result:
//apple
//banana
//strawberry
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
    </item>
    <item>
      <title>JavaScript Overview</title>
      <dc:creator>Arman</dc:creator>
      <pubDate>Sun, 09 May 2021 04:43:07 +0000</pubDate>
      <link>https://dev.to/tiarman/javascript-overview-102d</link>
      <guid>https://dev.to/tiarman/javascript-overview-102d</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;What is JavaScript?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;JavaScript is a very powerful client-side scripting language. JavaScript is used mainly for enhancing the interaction of a user with the webpage. In other words, you can make your webpage more lively and interactive, with the help of JavaScript. JavaScript is also being used widely in game development and Mobile application development.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oHeqLOMF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/184qygypp84fuihitd22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oHeqLOMF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/184qygypp84fuihitd22.png" alt="example"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Javascript History&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;JavaScript was developed by Brendan Eich in 1995, which appeared in Netscape, a popular browser of that time.&lt;br&gt;
The language was initially called LiveScript and was later renamed JavaScript. There are many programmers who think that JavaScript and Java are the same. In fact, JavaScript and Java are very much unrelated. Java is a very complex programming language whereas JavaScript is only a scripting language. The syntax of JavaScript is mostly influenced by the programming language C.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;How to Run JavaScript?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Being a scripting language, JavaScript cannot run on its own. In fact, the browser is responsible for running JavaScript code. When a user requests an HTML page with JavaScript in it, the script is sent to the browser and it is up to the browser to execute it. The main advantage of JavaScript is that all modern web browsers support JavaScript. So, you do not have to worry about whether your site visitor uses Internet Explorer, Google Chrome, Firefox or any other browser. JavaScript will be supported. Also, JavaScript runs on any operating system including Windows, Linux or Mac. Thus, JavaScript overcomes the main disadvantages of VBScript (Now deprecated) which is limited to just IE and Windows.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Tools You Need&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To start with, you need a text editor to write your code and a browser to display the web pages you develop. You can use a text editor of your choice including Notepad++, Visual Studio Code, Sublime Text, Atom or any other text editor you are comfortable with. You can use any web browser including Google Chrome, Firefox, Microsoft Edge, Internet Explorer etc.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;A Simple JavaScript Program&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You should place all your JavaScript code within  tags (&amp;lt;script&amp;gt; and ) if you are keeping your JavaScript code within the HTML document itself. This helps your browser distinguish your JavaScript code from the rest of the code. As there are other client-side scripting languages (Example: VBScript), it is highly recommended that you specify the scripting language you use. We have to use the type attribute within the &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag and set its value to text or javascript like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script type="text/javascript&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Hello World Example:&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;My First JavaScript code!!!&amp;lt;/title&amp;gt;
    &amp;lt;script type="text/javascript"&amp;gt;
        alert("Hello World!");
    &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; type="text/javascript" is not necessary in HTML5. Following code will work.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;My First JavaScript code!!!&amp;lt;/title&amp;gt;
    &amp;lt;script&amp;gt;
        alert("Hello World!");
    &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Assign a Value to the Variable&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;You can assign a value to the variable either while declaring the variable or after declaring the variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var name = "John";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;OR&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var name;

name = "John";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Naming Variables&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Variables!!!&amp;lt;/title&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
var one = 22;
var two = 3;
var add = one + two;
var minus = one - two;
var multiply = one * two;
var divide = one/two;
    document.write("First No: = " + one + "&amp;lt;br /&amp;gt;Second No: = " + two + " &amp;lt;br /&amp;gt;");
    document.write(one + " + " + two + " = " + add + "&amp;lt;br/&amp;gt;");
    document.write(one + " - " + two + " = " + minus + "&amp;lt;br/&amp;gt;");
    document.write(one + " * " + two + " = " + multiply + "&amp;lt;br/&amp;gt;");
    document.write(one + " / " + two + " = " + divide + "&amp;lt;br/&amp;gt;");
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;JavaScript Array Methods&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The Array object has many properties and methods which help developers to handle arrays easily and efficiently. You can get the value of a property by specifying arrayname.property and the output of a method by specifying arrayname.method().&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;length property&lt;/strong&gt; --&amp;gt; If you want to know the number of elements in an array, you can use the length property.&lt;br&gt;
&lt;strong&gt;prototype property&lt;/strong&gt; --&amp;gt; If you want to add new properties and methods, you can use the prototype property.&lt;br&gt;
&lt;strong&gt;reverse method&lt;/strong&gt; --&amp;gt; You can reverse the order of items in an array using a reverse method.&lt;br&gt;
&lt;strong&gt;sort method&lt;/strong&gt; --&amp;gt; You can sort the items in an array using sort method.&lt;br&gt;
&lt;strong&gt;pop method&lt;/strong&gt; --&amp;gt; You can remove the last item of an array using a pop method.&lt;br&gt;
&lt;strong&gt;shift method&lt;/strong&gt; --&amp;gt; You can remove the first item of an array using shift method.&lt;br&gt;
&lt;strong&gt;push method&lt;/strong&gt; --&amp;gt; You can add a value as the last item of the array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Arrays!!!&amp;lt;/title&amp;gt;
    &amp;lt;script type="text/javascript"&amp;gt;
        var students = new Array("John", "Ann", "Aaron", "Edwin", "Elizabeth");
        Array.prototype.displayItems=function(){
            for (i=0;i&amp;lt;this.length;i++){
                document.write(this[i] + "&amp;lt;br /&amp;gt;");
            }
        }   
        document.write("students array&amp;lt;br /&amp;gt;");
        students.displayItems();
        document.write("&amp;lt;br /&amp;gt;The number of items in students array is " + students.length + "&amp;lt;br /&amp;gt;");
        document.write("&amp;lt;br /&amp;gt;The SORTED students array&amp;lt;br /&amp;gt;");
        students.sort();
        students.displayItems();
        document.write("&amp;lt;br /&amp;gt;The REVERSED students array&amp;lt;br /&amp;gt;");
        students.reverse();
        students.displayItems();
        document.write("&amp;lt;br /&amp;gt;THE students array after REMOVING the LAST item&amp;lt;br /&amp;gt;");
        students.pop();
        students.displayItems();
        document.write("&amp;lt;br /&amp;gt;THE students array after PUSH&amp;lt;br /&amp;gt;");
        students.push("New Stuff");
        students.displayItems();
    &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
    </item>
    <item>
      <title>React Overview</title>
      <dc:creator>Arman</dc:creator>
      <pubDate>Fri, 07 May 2021 09:12:10 +0000</pubDate>
      <link>https://dev.to/tiarman/react-overview-28ao</link>
      <guid>https://dev.to/tiarman/react-overview-28ao</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;What Is React?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It lets you compose complex UIs from small and isolated pieces of code called “components”.&lt;/p&gt;

&lt;p&gt;React has a few different kinds of components, but we’ll start with React.Component subclasses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ShoppingList extends React.Component {
  render() {
    return (
      &amp;lt;div className="shopping-list"&amp;gt;
        &amp;lt;h1&amp;gt;Shopping List for {this.props.name}&amp;lt;/h1&amp;gt;
        &amp;lt;ul&amp;gt;
          &amp;lt;li&amp;gt;Instagram&amp;lt;/li&amp;gt;
          &amp;lt;li&amp;gt;WhatsApp&amp;lt;/li&amp;gt;
          &amp;lt;li&amp;gt;Oculus&amp;lt;/li&amp;gt;
        &amp;lt;/ul&amp;gt;
      &amp;lt;/div&amp;gt;
    );
  }
}

// Example usage: &amp;lt;ShoppingList name="Mark" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We’ll get to the funny XML-like tags soon. We use components to tell React what we want to see on the screen. When our data changes, React will efficiently update and re-render our components.&lt;/p&gt;

&lt;p&gt;Here, ShoppingList is a React component class, or React component type. A component takes in parameters, called props (short for “properties”), and returns a hierarchy of views to display via the render method.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Adding React to an HTML Page&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This quickstart tutorial will add React to a page like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;title&amp;gt;Test React&amp;lt;/title&amp;gt;

&amp;lt;!-- Load React API --&amp;gt;
&amp;lt;script src= "https://unpkg.com/react@16/umd/react.production.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;!-- Load React DOM--&amp;gt;
&amp;lt;script src= "https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;!-- Load Babel Compiler --&amp;gt;
&amp;lt;script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;body&amp;gt;

&amp;lt;script type="text/babel"&amp;gt;
    //  JSX Babel code goes here
&amp;lt;/script&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;What is Babel?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Babel is a JavaScript compiler that can translate markup or programming languages into JavaScript.&lt;/p&gt;

&lt;p&gt;With Babel, we can use the newest features of JavaScript (ES6 - ECMAScript 2015).&lt;/p&gt;

&lt;p&gt;Babel is available for different conversions. React uses Babel to convert JSX into JavaScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Please note that &amp;lt;script type="text/babel"&amp;gt; is needed for using Babel.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;What is JSX?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;JSX stands for JavaScript XML.&lt;/p&gt;

&lt;p&gt;JSX is an XML/HTML like extension to JavaScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const element = &amp;lt;h1&amp;gt;Hello World!&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see above, JSX is not JavaScript nor HTML.&lt;/p&gt;

&lt;p&gt;JSX is a XML syntax extension to JavaScript that also comes with the full power of ES6 (ECMAScript 2015).&lt;/p&gt;

&lt;p&gt;Just like HTML, JSX tags can have a tag names, attributes, and children. If an attribute is wrapped in curly braces, the value is a JavaScript expression.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Note that JSX does not use quotes around the HTML text string.&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;React DOM Render:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The method ReactDom.render() is used to render (display) HTML elements:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div id="id01"&amp;gt;Hello World!&amp;lt;/div&amp;gt;

&amp;lt;script type="text/babel"&amp;gt;
ReactDOM.render(
    &amp;lt;h1&amp;gt;Hello React!&amp;lt;/h1&amp;gt;,
    document.getElementById('id01'));
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;JSX Expressions:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Expressions can be used in JSX by wrapping them in curly {} braces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div id="id01"&amp;gt;Hello World!&amp;lt;/div&amp;gt;

&amp;lt;script type="text/babel"&amp;gt;
const name = 'John Doe';
ReactDOM.render(
    &amp;lt;h1&amp;gt;Hello {name}!&amp;lt;/h1&amp;gt;,
    document.getElementById('id01'));
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;React Elements&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;React applications are usually built around a single HTML element.&lt;/p&gt;

&lt;p&gt;React developers often call this the root node (root element):&lt;br&gt;
&lt;code&gt;&amp;lt;div id="root"&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;React elements look like this:&lt;br&gt;
&lt;code&gt;const element = &amp;lt;h1&amp;gt;Hello React!&amp;lt;/h1&amp;gt;&lt;/code&gt;&lt;br&gt;
Elements are rendered (displayed) with the ReactDOM.render() method:&lt;br&gt;
&lt;code&gt;ReactDOM.render(element, document.getElementById('root'));&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;React elements are immutable. They cannot be changed.&lt;/p&gt;

&lt;p&gt;The only way to change a React element is to render a new element every time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function tick() {
    const element = (&amp;lt;h1&amp;gt;{new Date().toLocaleTimeString()}&amp;lt;/h1&amp;gt;);
    ReactDOM.render(element, document.getElementById('root'));
}
setInterval(tick, 1000);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;React Components&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;React components are JavaScript functions.&lt;/p&gt;

&lt;p&gt;This example creates a React component named "Welcome":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Welcome() {
    return &amp;lt;h1&amp;gt;Hello React!&amp;lt;/h1&amp;gt;;
}
ReactDOM.render(&amp;lt;Welcome /&amp;gt;, document.getElementById('root'));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React can also use ES6 classes to create components.&lt;/p&gt;

&lt;p&gt;This example creates a React component named Welcome with a render method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Welcome extends React.Component {
    render() { return(&amp;lt;h1&amp;gt;Hello React!&amp;lt;/h1&amp;gt;); }
}
ReactDOM.render(&amp;lt;Welcome /&amp;gt;, document.getElementById('root'));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;React Component Properties&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This example creates a React component named "Welcome" with property arguments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Welcome(props) {
    return &amp;lt;h1&amp;gt;Hello {props.name}!&amp;lt;/h1&amp;gt;;
}
ReactDOM.render(&amp;lt;Welcome name="John Doe"/&amp;gt;, document.getElementById('root'));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React can also use ES6 classes to create components.&lt;/p&gt;

&lt;p&gt;This example also creates a React component named "Welcome" with property arguments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Welcome extends React.Component {
    render() { return(&amp;lt;h1&amp;gt;Hello {this.props.name}&amp;lt;/h1&amp;gt;); }
}
ReactDOM.render(&amp;lt;Welcome name="John Doe"/&amp;gt;, document.getElementById('root'));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  JSX Compiler
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;The examples on this page compiles JSX in the browser.&lt;br&gt;
For production code, the compilation should be done separately.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Create React Application&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Facebook has created a Create React Application with everything you need to build a React app.&lt;/p&gt;

&lt;p&gt;It is a a development server that uses Webpack to compile React, JSX, and ES6, auto-prefix CSS files.&lt;/p&gt;

&lt;p&gt;The Create React App uses ESLint to test and warn about mistakes in the code.&lt;/p&gt;

&lt;p&gt;To create a Create React App run the following code on your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app react-tutorial
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure you have Node.js 5.2 or higher. Otherwise you must install npx:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i npx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start one folder up from where you want your application to stay:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\Users\myUser&amp;gt;npx create-react-app react-tutorial
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Success Result:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx: installed 63 in 10.359s
Creating a new React app in C:\Users\myUser\react-tutorial.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
+ react-dom@16.5.2
+ react@16.5.2
+ react-scripts@2.0.4
added 1732 packages from 664 contributors and audited 31900 packages in 355.501s
found 0 vulnerabilities+ react@16.5.2

Success! Created react-tutorial at C:\Users\myUser\react-tutorial
Inside that directory, you can run several commands:

npm start
Starts the development server.

npm run build
Bundles the app into static files for production.

npm test
Starts the test runner.

npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can't go back!

We suggest that you begin by typing:

cd react-tutorial
npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
