<?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: R-Villar</title>
    <description>The latest articles on DEV Community by R-Villar (@rvillar).</description>
    <link>https://dev.to/rvillar</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%2F891064%2F2db550b0-06bb-4a6d-95d5-718e2b342b4b.png</url>
      <title>DEV Community: R-Villar</title>
      <link>https://dev.to/rvillar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rvillar"/>
    <language>en</language>
    <item>
      <title>My experience while attending Flatiron's Software Engineering Bootcamp.</title>
      <dc:creator>R-Villar</dc:creator>
      <pubDate>Tue, 04 Oct 2022 16:23:36 +0000</pubDate>
      <link>https://dev.to/rvillar/what-not-to-do-while-attending-software-engineering-bootcamp-3hno</link>
      <guid>https://dev.to/rvillar/what-not-to-do-while-attending-software-engineering-bootcamp-3hno</guid>
      <description>&lt;p&gt;At the start of 2022, I had begun my first semester for a B.S. in Computer Science, but the thought of having to wait two years to complete my education and then start looking for a job in the industry made me anxious. Then, I heard from my partner about someone who had completed the Flatiron school software engineering program and was successful with it while having no prior coding experience. &lt;/p&gt;

&lt;p&gt;I decided to reach out to the school and got all the information I needed. As soon as my spring semester ended, I got thru their pre-work and was enrolled to attend in June. The first three weeks were not easy, it was a lot of material to get thru, but I did not want to fall behind on the work. I tried my best to stay focused on the work, but if I got distracted, I would take a break. I soon noticed I got diverted because I did not completely understand a topic. Taking breaks at those times helped me clear my mind and was a requirement later in the program. &lt;/p&gt;

&lt;p&gt;During the program, I had to work on projects as a team, and we had to decide what we would develop and how and we always had to use the skills we had been learning. It was a great experience, as I got to see how others wrote their code and how they approached problems. Seeing the different ways we could tackle the same problem pushed us to find optimal ways to get the problem solved. It was also beneficial because we learned to explain our ideas better so others would understand our vision. &lt;/p&gt;

&lt;p&gt;Overall my experience was excellent; the instructors were great and engaging, and they challenged and pushed you as much as possible. It amazes me how much you can learn in 15 weeks and put our learning into practice. It was a gratifying experience; you will get a lot out of it if you dedicate the time it needs. &lt;/p&gt;

&lt;p&gt;If I could change one thing about the whole experience, it would have been not working while attending the program. It was something the admissions lead explicitly told me before enrolling. Even though I worked part-time as a nursing assistant on the weekends, it wasn't easy. Without the support of my partner and family, the whole experience would have been very different. &lt;/p&gt;

&lt;p&gt;Overall I would recommend the program, I was very skeptical before attending, but it was well worth it. &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>help</category>
    </item>
    <item>
      <title>Rails Generators: Model or Resource?</title>
      <dc:creator>R-Villar</dc:creator>
      <pubDate>Wed, 14 Sep 2022 02:36:00 +0000</pubDate>
      <link>https://dev.to/rvillar/rails-generators-model-or-resource-30be</link>
      <guid>https://dev.to/rvillar/rails-generators-model-or-resource-30be</guid>
      <description>&lt;p&gt;Rails is a powerful tool for a developer, you can do so much with just a few keystrokes in the command line. When you first learn about generators the one thing that goes through your mind is "This will make my life so much easier", And it will. But this is the moment when you should take a step back and try to understand why and how will this magical generators will change your life. First you need to know what they are. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are Generators??&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Rails generators are command line tools that are used for automating the process of creating or editing files with boiler plate code. In essence, they execute Ruby code much like a script and create or update files based on templates, user input and whatever logic necessary.&lt;/p&gt;

&lt;p&gt;Now that you know that lets run some generators! &lt;/p&gt;

&lt;p&gt;In the command line, you can type &lt;code&gt;rails generate&lt;/code&gt; or &lt;code&gt;rails g&lt;/code&gt; these will both get you the same result. Running this by itself will give you a list of available generators. &lt;/p&gt;

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

&lt;p&gt;and much more. &lt;/p&gt;

&lt;p&gt;Let's generate some code.&lt;/p&gt;

&lt;p&gt;We will begin by creating a migration. &lt;/p&gt;

&lt;p&gt;Running this code &lt;code&gt;rails g model car name brand model year:integer trim&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;This will create a migration a model and some test. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wm0q9zZv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7k8yctc5m5a7xe6cb9e4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wm0q9zZv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7k8yctc5m5a7xe6cb9e4.png" alt="Image description" width="422" height="103"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nqVNj8Vh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nxehna0caqp6fywuthah.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nqVNj8Vh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nxehna0caqp6fywuthah.png" alt="Image description" width="535" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is great! we were able to get all that from just one line of code in the terminal. &lt;/p&gt;

&lt;p&gt;What if we can get even more done from the terminal? make this even easier! that where resource come in! by just changing the command we ran before from model to resource &lt;code&gt;rails g resource car name brand model year:integer trim&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We get even more! migrations, models, test, controllers, routes and serializer.&lt;/p&gt;

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

&lt;p&gt;If you are starting to get a bit overwhelmed, well it is. &lt;br&gt;
This is the time that you as a developer need to stop and think, generating all that code for you is amazing! It will improve your work flow but if you are still new to rails and generators this is where you need to slow down. Understanding what is happening with the code you generate is very important, it will help you debug your code &lt;em&gt;when&lt;/em&gt; something goes wrong. Key word is &lt;em&gt;when&lt;/em&gt; not if, we will all make mistakes while writing code. &lt;/p&gt;

&lt;p&gt;Shortcuts have no place in programming, besides wouldn't you want to understand all that magical code you write. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://guides.rubyonrails.org/active_record_migrations.html#model-generators"&gt;generators&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rails</category>
      <category>ruby</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Create a table with ActiveRecord.</title>
      <dc:creator>R-Villar</dc:creator>
      <pubDate>Wed, 24 Aug 2022 02:50:52 +0000</pubDate>
      <link>https://dev.to/rvillar/create-a-table-with-activerecord-4g5c</link>
      <guid>https://dev.to/rvillar/create-a-table-with-activerecord-4g5c</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is ActiveRecord?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ActiveRecord is the M in the MVC (Model-view-controller). The model is the layer of the system responsible for representing data and logic. Active Record facilitates the creation and use of objects whose data requires persistent storage to the database.&lt;/p&gt;

&lt;p&gt;ActiveRecord facilitates building tables using Ruby. As well as, enabling us to interact with a database to retrieve properties and relationships of the objects in an application without writing SQL statements. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to create a table with ActiveRecord?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Creating a table is simple, but before you do that you have to create a migration before setting up your table. to create the migration you have to run this command on the terminal &lt;code&gt;rake db:create_migration NAME=&amp;lt;name-migration&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After you do this you will have new file like this.&lt;/p&gt;

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

&lt;p&gt;Inside of this file we will create our table method.&lt;/p&gt;

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

&lt;p&gt;After the table name artists we write a a block of code that is passed a block parameter &lt;code&gt;t&lt;/code&gt;. It is a special Active Record migration object that helps add different columns to the table. &lt;/p&gt;

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

&lt;p&gt;After this we run &lt;code&gt;rake db:migrate&lt;/code&gt;&lt;br&gt;
Active Record will create a new database file. &lt;/p&gt;

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

&lt;p&gt;This will also create a &lt;code&gt;db/schema.rb&lt;/code&gt; this is used as a snapshot of the current state of the database. &lt;/p&gt;

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

&lt;p&gt;We then create an Artist class and extend the class with ActiveRecord::Base&lt;/p&gt;

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

&lt;p&gt;We then are able to instantiate a new Artist.&lt;/p&gt;

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

&lt;p&gt;After creating a few more Artists we can see all of their information. &lt;/p&gt;

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

&lt;p&gt;sources:&lt;br&gt;
&lt;a href="https://guides.rubyonrails.org/active_record_basics.html"&gt;ActiveRecord&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Destructuring Props in React.</title>
      <dc:creator>R-Villar</dc:creator>
      <pubDate>Mon, 01 Aug 2022 13:11:25 +0000</pubDate>
      <link>https://dev.to/rvillar/destructuring-props-in-react-4ibd</link>
      <guid>https://dev.to/rvillar/destructuring-props-in-react-4ibd</guid>
      <description>&lt;p&gt;Once you begin your journey of learning React, one of the first things you will learn about is Props. If you are already familiar with how functions and arguments work in JavaScript, grasping Props will not be difficult. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are Props?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Props are arguments passed into React components, Props are also passed to components by HTML attributes. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Destructuring?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is a convenient way of accessing the multiple properties stored in objects and arrays. &lt;/p&gt;

&lt;p&gt;Let's get started with an example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function App() {
  const car = {
    brand: 'Jeep',
    model: 'gladiator',
    year: '2022',
    color: 'red',
    price: '37,000',
  };

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;cars car={car} /&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}

function displayCar({car}) {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;p&amp;gt;My car's brand is, {car.brand}&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we have our car object inside of App, we pass it as a prop to the component Cars. Inside of the Cars component we now have access to the car object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function displayCar({car}) {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;p&amp;gt;My car's brand is, {car.brand}&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see above we now can use dot notation to access the information, but what if we can destructure the prop and clean up the code.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const {brand, model, year,  color, price} = car&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;we can destructure the car object and our code will be a bit cleaner and mode readable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function displayCar({car}) {
  const {brand, model, color} = car
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;p&amp;gt;My car's brand is, {brand}&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;My car's model is, {model}&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;My car's color is, {color}&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will be what you will see on screen. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;My car's brand is, Jeep&lt;br&gt;
 My car's model is, gladiator&lt;br&gt;
 My car's color is, red&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;From a beginners point of view this is one of the simple ways to destructure but it is far from the only one, things can get complicated really quickly when the amount of data you are working with is substantial.&lt;/p&gt;

&lt;p&gt;resources:&lt;br&gt;
&lt;a href="https://reactjs.org/docs/components-and-props.html"&gt;https://reactjs.org/docs/components-and-props.html&lt;/a&gt;&lt;br&gt;
react image:&lt;br&gt;
&lt;a href="https://mobile.twitter.com/reactjs"&gt;https://mobile.twitter.com/reactjs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Const, Let or Var which should you use??</title>
      <dc:creator>R-Villar</dc:creator>
      <pubDate>Wed, 13 Jul 2022 00:57:40 +0000</pubDate>
      <link>https://dev.to/rvillar/const-let-or-var-which-should-you-use-45f2</link>
      <guid>https://dev.to/rvillar/const-let-or-var-which-should-you-use-45f2</guid>
      <description>&lt;p&gt;When starting to learn JavaScript, one of the first things we learn is the how to declare variables. Choosing between &lt;code&gt;var&lt;/code&gt;, &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt; can be the start of frustration when you are beginning to learn JavaScript for the first time. &lt;br&gt;
The first thing you learn is that &lt;code&gt;var&lt;/code&gt; can be redeclare and undated and you will not get any errors.&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 = "Remy";
var name = "Danny";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the problem with using &lt;code&gt;var&lt;/code&gt; is after writing hundreds of lines of code, you reuse the same variable name you will not get an error but it will lead to bugs in your code. &lt;/p&gt;

&lt;p&gt;This is where &lt;code&gt;let&lt;/code&gt; comes in it fixes the problems with using  &lt;code&gt;var&lt;/code&gt;. Variables declared with &lt;code&gt;let&lt;/code&gt; can be updated just like &lt;code&gt;var&lt;/code&gt; but they can not be re-declared.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let name = "Remy";
let name = "Kathy"; // Identifier 'name' has already been declared
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is also good to remember that you can declare the same variable if they are in different scopes. This means you can re-declare the variable inside a function or anywhere that is surrounded by &lt;code&gt;{}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The other option we have to declare variables is &lt;code&gt;const&lt;/code&gt; they maintain their constant value. &lt;code&gt;const&lt;/code&gt; unlike &lt;code&gt;var&lt;/code&gt; and &lt;code&gt;let&lt;/code&gt; can not be re-declared or updated with in its scope, and we are unable to have this problem.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const name = "Kathy";
const name = "Danny"; // Identifier 'name' has already been declared
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the small amount of time I have been writing and learning JavaScripts, this was one of the things I always had to keep in mind when declaring variables. Always keeping in mind which one will be the right one for the job.&lt;/p&gt;

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