<?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>Forem: ana</title>
    <description>The latest articles on Forem by ana (@anateotfw).</description>
    <link>https://forem.com/anateotfw</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%2F984157%2Fdd464954-4a6e-4803-baaf-23692a1ac3b8.jpg</url>
      <title>Forem: ana</title>
      <link>https://forem.com/anateotfw</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/anateotfw"/>
    <language>en</language>
    <item>
      <title>Return an element in console</title>
      <dc:creator>ana</dc:creator>
      <pubDate>Thu, 04 May 2023 17:13:17 +0000</pubDate>
      <link>https://forem.com/anateotfw/return-an-element-in-console-lj6</link>
      <guid>https://forem.com/anateotfw/return-an-element-in-console-lj6</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VohYPVso--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/30p5h2iqu42h43rdwtnd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VohYPVso--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/30p5h2iqu42h43rdwtnd.png" alt="Image description" width="800" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Do you want see an element that you create in your HTML on console by JS?&lt;/p&gt;

&lt;p&gt;It's so easy and simple.&lt;br&gt;
there is no more explain about this, but you should know some small tips about it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We can do this with using from &lt;code&gt;getElementById()&lt;/code&gt; method.&lt;br&gt;
this return one element with specified ID.&lt;br&gt;
you should remember that: your IDs name should be unique.&lt;br&gt;
and you should use "variables name rule" for your IDs name.&lt;/p&gt;

&lt;p&gt;Here our answer:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;select an element with this method like that:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.getElementById("demo");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;This would return the full HTML element:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1 id="demo"&amp;gt;Hello world.&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;We should write our method in &lt;code&gt;console.log&lt;/code&gt; as we know for 
see it in console:
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;/div&gt;



&lt;p&gt;Finally, I must mention, these things I said are about "HtmlDom" topic in JS. &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>react</category>
    </item>
    <item>
      <title>javaScript Class</title>
      <dc:creator>ana</dc:creator>
      <pubDate>Fri, 03 Mar 2023 12:41:09 +0000</pubDate>
      <link>https://forem.com/anateotfw/javascript-class-5hi1</link>
      <guid>https://forem.com/anateotfw/javascript-class-5hi1</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2ecA7cCJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nf2iumvnq80uzoc7ibet.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2ecA7cCJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nf2iumvnq80uzoc7ibet.png" alt="Image description" width="880" height="573"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this article I just want explain a little about &lt;code&gt;class&lt;/code&gt; topic in java script.&lt;br&gt;
As you know Class its a concept that you can see in any programming language.&lt;br&gt;
letsGo...&lt;br&gt;
In first I show you syntax of class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ClassName{
constructor(){...}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tip/ normally we write class name with capital letter.&lt;/p&gt;

&lt;p&gt;Here there is 1 question! what is &lt;code&gt;constructor&lt;/code&gt;?&lt;br&gt;
actually the constructor is a place that we declare all variable we want use in our class, in every function we make it later, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Human{
constructor(name, lName, age){
this.name = name;
this.lName = lName; 
this.age = age;
}
...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;as you can see in above codes I declare All variables in &lt;code&gt;constructor&lt;/code&gt;. just for you know, the constructor in JS is &lt;code&gt;__init__&lt;/code&gt; in python. &lt;/p&gt;

&lt;p&gt;well it doesn't matter. anyway, after make your constructor maybe you want to use from those in your functions..&lt;br&gt;
if I want show this in example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Human{
constructor(name, lName, age){
this.name = name;
this.lName = lName; 
this.age = age;
}
showName(){
console.log(this.name + " " + this.lName);
}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tip1/ showName is a function.&lt;br&gt;
Tip2/ this keyword refers to variable we declare in our class and you should use from that.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;so How can we use from our Class?&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const VariableName = new ClassName(parameter1, parameter2,...)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;in example:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const person1  = new Human("Ana", "am", "19");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tip1/ order for declare value is important. if i Write "19" at the first that value it will equal to &lt;code&gt;name&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How can we use from our Function? (showName)&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;person1.showName();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;I should tell you, in this subject(class) there are so many tips. and you should care about this and learn more about it. I just explained the class topic in really short form.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Don't forget practice.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>java script Hoisting</title>
      <dc:creator>ana</dc:creator>
      <pubDate>Fri, 24 Feb 2023 09:39:01 +0000</pubDate>
      <link>https://forem.com/anateotfw/java-script-hoisting-52j2</link>
      <guid>https://forem.com/anateotfw/java-script-hoisting-52j2</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F04lo1maxpxs9hf0o81ri.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F04lo1maxpxs9hf0o81ri.png" alt=" " width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;HI!&lt;br&gt;
in this article i want explain &lt;code&gt;Hoist&lt;/code&gt; and &lt;code&gt;Hoisting&lt;/code&gt; rule in java script. as you know javaScript its a language with a lot concept and rules and tips. so Hoisting its another rule of &lt;code&gt;variable&lt;/code&gt; in javaScript, so important and for your programming way it can be so good and helpful.&lt;/p&gt;

&lt;p&gt;Hoisting is about Declaration and this things.&lt;br&gt;
there is some way for declare and use and display a variable and value of that variable.&lt;br&gt;
for example:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;maybe after this you say with yourself main rule for declare a variable is this:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;yes, in general we declare with this rule and syntax but if we use from those syntax we use from &lt;code&gt;Hoist&lt;/code&gt; rule in our program.&lt;br&gt;
but believe me Hoist its can be useful and helpful, every rules in javaScript is so helpful and good for our way.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip/ we can't use &lt;code&gt;const&lt;/code&gt; or &lt;code&gt;let&lt;/code&gt; keyword for above example, this will result  in a &lt;code&gt;ReferenceError&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>indie</category>
      <category>tools</category>
      <category>ai</category>
      <category>discuss</category>
    </item>
    <item>
      <title>if_else in java script:</title>
      <dc:creator>ana</dc:creator>
      <pubDate>Thu, 23 Feb 2023 14:26:26 +0000</pubDate>
      <link>https://forem.com/anateotfw/ifelse-in-java-script-5e35</link>
      <guid>https://forem.com/anateotfw/ifelse-in-java-script-5e35</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F293hl19d4g96e5gf33ks.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F293hl19d4g96e5gf33ks.png" alt=" " width="800" height="525"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;in this article i want explain some Tip about &lt;code&gt;if&lt;/code&gt; and &lt;code&gt;else&lt;/code&gt;.&lt;br&gt;
in javaScript and also in another programming languages, the name of this topic is : &lt;code&gt;Conditional Statements&lt;/code&gt;.&lt;br&gt;
Im sure that you see this topic in your programming way in any language you work with it..&lt;br&gt;
so you should know we use &lt;code&gt;if&lt;/code&gt; and &lt;code&gt;else&lt;/code&gt; word for our usage.&lt;br&gt;
anyway, at first I write the syntax of if, else, etc.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;if&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (condition) {
  //  the things we want will be done if the conditions are True.
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;else&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (condition) {
  //  the things we want will be done if the conditions are True.
} else {
  //  the things we want will be done if the conditions are False.
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;else if&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (condition1) {
  //  the things we want will be done if the condition1 is True.
} else if (condition2) {
  //  the things we want will be done if the condition1 is False.
} else {
  //  the things we want will be done if the condition1 and condition2 is False.
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so it's done... these is all about if, else and else if.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;at the end, i write a example and you write the answer in comment if you like;)&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

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

if (x = 0){
console.log("I should keep going, it doesn't matter how hard is!");
}else if (x = 00){
console.log("trying it's my answer");
}else{
console.log("i should not have shame feeling about trying");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;enjoy,byeeeeè.&lt;/p&gt;

</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>Arrow Function</title>
      <dc:creator>ana</dc:creator>
      <pubDate>Wed, 15 Feb 2023 18:45:02 +0000</pubDate>
      <link>https://forem.com/anateotfw/arrow-function-clg</link>
      <guid>https://forem.com/anateotfw/arrow-function-clg</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx52jar1sxwgitzrklcyc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx52jar1sxwgitzrklcyc.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Before explain Arrow function you should learn EcmaScript(6)&lt;br&gt;
and learn about that. &lt;/p&gt;

&lt;p&gt;So.. I just explain a little about that:  is a JavaScript standard intended to ensure the interoperability of web pages across different browsers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;well, now we arrived to ArrowFunction.&lt;br&gt;
as you know ecmaScript has multiple versions, in last version(5) arrowFunction was somthing like that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const function1 = function(x, y) {
   return x * y;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But in the next version arrowFunction in ecmaScript changed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const function1 =(x, y)=&amp;gt; x * y;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so whenever you see this symbol &lt;code&gt;=()=&amp;gt;&lt;/code&gt; in javaScript its mean Arrow Function!!&lt;/p&gt;

&lt;p&gt;this is very important topic in java script, if one day you want to learn &lt;code&gt;React&lt;/code&gt; you need to know what is arrowFunction and how should use from it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;as you see, we declare a variable with const and gave a name to it and then after equal symbol &lt;code&gt;=&lt;/code&gt; we gave our arguments in the parentheses and use from this &lt;code&gt;=&amp;gt;&lt;/code&gt;, after this line we just return our output, remember this, it doesn't matter to use &lt;code&gt;return&lt;/code&gt; word or not, but in React!! is so important.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>react</category>
    </item>
    <item>
      <title>JavaScript function call() method:</title>
      <dc:creator>ana</dc:creator>
      <pubDate>Fri, 03 Feb 2023 15:46:12 +0000</pubDate>
      <link>https://forem.com/anateotfw/javascript-function-call-and-apply-method-3noo</link>
      <guid>https://forem.com/anateotfw/javascript-function-call-and-apply-method-3noo</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F94ovemu6x6lmop0mopuu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F94ovemu6x6lmop0mopuu.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;imaging that: you have some object in your program(with JS language) and you have some &lt;code&gt;name:value&lt;/code&gt; in your object with any data type.&lt;br&gt;
if we say any data type that can be to this mean we want write a name:value and "value" be a function?&lt;br&gt;
Ofcourse!! &lt;/p&gt;

&lt;p&gt;if function situation is to be that, function take two parameters and then return their in output, and if we want specify our parameters from a another object we can use &lt;code&gt;call&lt;/code&gt; method!&lt;/p&gt;

&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const x = {
fullName: function(){
return this.name + " " + this.lName
}
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But where is name or lName(last name)?&lt;/p&gt;

&lt;p&gt;is here: (in another object, we take from this object)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const object1 = {
name: "ana",
lName: "amini"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So now we achieve to &lt;code&gt;method part&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;and then output will be like that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ana amini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tip(1): for showing a value of the name in object we use from this rule: &lt;code&gt;objectName.name1&lt;/code&gt;;&lt;/p&gt;

&lt;p&gt;Tip(2): we use &lt;code&gt;" "&lt;/code&gt; in our function, so our values are separate from each other!&lt;/p&gt;

&lt;p&gt;;)!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>node</category>
    </item>
    <item>
      <title>Array Or Object In JavaScript language.</title>
      <dc:creator>ana</dc:creator>
      <pubDate>Fri, 23 Dec 2022 09:12:39 +0000</pubDate>
      <link>https://forem.com/anateotfw/array-or-object-in-javascript-language-1i6n</link>
      <guid>https://forem.com/anateotfw/array-or-object-in-javascript-language-1i6n</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fimmce2131hmns1zpi44i.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fimmce2131hmns1zpi44i.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Array&lt;/strong&gt; or &lt;strong&gt;Object&lt;/strong&gt; It is a very important topic in JS.&lt;br&gt;
If you want to learn javaScript in a website, youTube, book or All facilities.. there is a subject with this name =&amp;gt; &lt;strong&gt;Array&lt;/strong&gt; and &lt;strong&gt;object&lt;/strong&gt;.&lt;br&gt;
And something else that should be here, is difference between these two =&amp;gt; Array and Object.&lt;br&gt;
in first we should know what is Array! and then what is Object!!&lt;/p&gt;

&lt;p&gt;before I explain, I want to tell you some resources for learn JS.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.w3schools.com/js/default.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/js/default.asp&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://overapi.com/javascript" rel="noopener noreferrer"&gt;https://overapi.com/javascript&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;3.&lt;a href="https://www.javascript.com/" rel="noopener noreferrer"&gt;https://www.javascript.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;but you should know "Books" is better than every choice for learn JS.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;like "&lt;strong&gt;javasSript from beginner to professional&lt;/strong&gt;" || "&lt;strong&gt;you don't know javaScript&lt;/strong&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;( yup, I use || for Or;) if you know..).&lt;/p&gt;
&lt;h2&gt;
  
  
  syntax of a Array:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frnlzv331x9jolfmeivvz.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frnlzv331x9jolfmeivvz.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;There are three points here:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I use &lt;code&gt;[]&lt;/code&gt; for write a &lt;strong&gt;Array&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;I use any name I like for &lt;strong&gt;Variable&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;I can use from &lt;strong&gt;var&lt;/strong&gt; or &lt;strong&gt;let&lt;/strong&gt; instead &lt;strong&gt;const&lt;/strong&gt;.(but there is some rules for that, and usually we use &lt;strong&gt;const&lt;/strong&gt; for write a Array.)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;if you don't know what is &lt;strong&gt;var&lt;/strong&gt; or &lt;strong&gt;let&lt;/strong&gt; or maybe &lt;strong&gt;const&lt;/strong&gt;, check here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/js/js_variables.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/js/js_variables.asp&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  syntax of Object:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkieh12lthlm1ziqvapvh.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkieh12lthlm1ziqvapvh.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;and Object Points..:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I use&lt;code&gt;{}&lt;/code&gt; for write a Object.&lt;/li&gt;
&lt;li&gt;I use a &lt;strong&gt;variable&lt;/strong&gt; for every item in Object.&lt;/li&gt;
&lt;li&gt;name, age, nationality its a "key" for "value" I wrote in front of it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;well, in end remember that: &lt;br&gt;
name, age, etc.. its a "key" &lt;br&gt;
ana, 19, etc.. its a "value"&lt;br&gt;
and we say that =&amp;gt; &lt;br&gt;
&lt;strong&gt;name&lt;/strong&gt; is a &lt;strong&gt;key&lt;/strong&gt; for &lt;strong&gt;ana&lt;/strong&gt; and &lt;strong&gt;ana&lt;/strong&gt; its a &lt;strong&gt;value&lt;/strong&gt;.&lt;br&gt;
=&amp;gt; We say in the term (key-value).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  syntax for &lt;strong&gt;array&lt;/strong&gt;:
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const arrayName = [value1, value2,...]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  syntax for &lt;strong&gt;object&lt;/strong&gt;:
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const objectName = {key1 : value1, ...}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  The difference between Array And Object:
&lt;/h2&gt;

&lt;p&gt;now we should let's answer to that question:&lt;br&gt;
what is difference between a Array and a object?&lt;/p&gt;

&lt;p&gt;as you can see: I wrote &lt;strong&gt;array&lt;/strong&gt; with [ ] and then I wrote directly value on it.&lt;/p&gt;

&lt;p&gt;and then I wrote &lt;strong&gt;object&lt;/strong&gt; with { } and write value but after key of that value.&lt;/p&gt;

&lt;p&gt;but the main difference between a &lt;strong&gt;Array&lt;/strong&gt; and &lt;strong&gt;Object&lt;/strong&gt; its &lt;strong&gt;index&lt;/strong&gt; of these two.&lt;/p&gt;

&lt;p&gt;"index" its really easy and important subject and rule for array and object in JS.&lt;/p&gt;

&lt;p&gt;in a Array every value from first have a index and that index start with 0, and then 1 and then 2 and...n. you should know we can't change that rule for Array. but in object:&lt;/p&gt;

&lt;p&gt;in a Object every value from first have index but that index is what we call, for example for "ana" I give "name" for index of this value.&lt;br&gt;
for another value I give index I want, after that in our program we wrote and we have Object&lt;br&gt;
every value in Object have index and that index its "key" we wrote for value.&lt;/p&gt;
&lt;h2&gt;
  
  
  summery:
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;index of &lt;strong&gt;array&lt;/strong&gt; start with 0,1,2,...:&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const array1 = ["a", "b"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;=&amp;gt; index of "a" its: 0&lt;br&gt;
=&amp;gt; index of "b" its: 1&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;index of &lt;strong&gt;object&lt;/strong&gt; start with key1, key2,..:&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const object1 = {name: "ana", age:"19"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;=&amp;gt; index of "ana" its name&lt;br&gt;
=&amp;gt; index of "19" its age&lt;/p&gt;

&lt;p&gt;&lt;em&gt;forgive me if I forget &lt;strong&gt;semicolon&lt;/strong&gt; :)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The end.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>git</category>
    </item>
  </channel>
</rss>
