<?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: Marcos Freitas</title>
    <description>The latest articles on Forem by Marcos Freitas (@marcos_freitas_1742547f09).</description>
    <link>https://forem.com/marcos_freitas_1742547f09</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%2F972324%2F5a2a2a0b-f7ee-4ac9-8737-84ddb56b7b80.jpeg</url>
      <title>Forem: Marcos Freitas</title>
      <link>https://forem.com/marcos_freitas_1742547f09</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/marcos_freitas_1742547f09"/>
    <language>en</language>
    <item>
      <title>Using Postman to Test APIs</title>
      <dc:creator>Marcos Freitas</dc:creator>
      <pubDate>Wed, 04 Jan 2023 13:08:42 +0000</pubDate>
      <link>https://forem.com/marcos_freitas_1742547f09/using-postman-to-test-apis-3g9h</link>
      <guid>https://forem.com/marcos_freitas_1742547f09/using-postman-to-test-apis-3g9h</guid>
      <description>&lt;p&gt;I must confess it took me a bit to understand the functionalities and purposes of using Postman as a client to make non-GET requests. For some reason I did not see it as a testing app at first and kept using the browser as a client to run my backend API tests. In the browser you can run GET requests and get json data back in the URL or by fetching with chrome dev tools (option + command + J). There is also Curl, which is a client built in your machine terminal that can also fetch and get json data as response. However, it is more complicated and time consuming making other HTTP requests like a POST, PATCH, or DELETE in the browser other than with Postman. Adding more practice to using Postman, I came to understand it better and prefer to use it now to run my backend tests instead of the browser or curl. &lt;br&gt;
   In case you don't have Postman yet, you can download it in your platform at: &lt;a href="https://www.postman.com/downloads/"&gt;https://www.postman.com/downloads/&lt;/a&gt;&lt;br&gt;
   While creating a web application with Rails, you need to take HTTP requests and return a json response that follows the idea of client-server communication. In case you forget your HTTP requests, paths, its controller actions, and what is used for you can check this website for references; &lt;a href="https://guides.rubyonrails.org/routing.html"&gt;https://guides.rubyonrails.org/routing.html&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;See Postman request examples below:&lt;/p&gt;

&lt;p&gt;GET request to show all &lt;/p&gt;

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

&lt;p&gt;GET request to show a specific id &lt;/p&gt;

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

&lt;p&gt;GET with id error status and message working &lt;/p&gt;

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

&lt;p&gt;POST request to create a new id &lt;/p&gt;

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

&lt;p&gt;PATCH request to update an id&lt;/p&gt;

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

&lt;p&gt;Last but not least a DELETE request to delete/destroy an id &lt;/p&gt;

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

&lt;p&gt;Results that your id was successfully deleted. &lt;br&gt;
You can either check with a Postman GET(index) request to see your last id or you can also close your terminal with (control + C) and in your project directory run (rail c) to run test and see if your updates worked and the data arrived. Then exit to leave your (rails c). A common mistake I did multiple times was to go back to my Postman after running tests with (rails c) and forgetting to open your rails server (rails s). &lt;/p&gt;

&lt;p&gt;In conclusion, there are different clients (Browser, Curl, Postman) that you can use to run your backend APIs data to get a json response. And it is always up to the developer how they will run their tests depending on what they are more comfortable with using.&lt;/p&gt;

&lt;p&gt;REFERENCES &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.postman.com/downloads/"&gt;https://www.postman.com/downloads/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://guides.rubyonrails.org/routing.html"&gt;https://guides.rubyonrails.org/routing.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>postman</category>
      <category>api</category>
      <category>backend</category>
      <category>rails</category>
    </item>
    <item>
      <title>Happy Seeding with Faker</title>
      <dc:creator>Marcos Freitas</dc:creator>
      <pubDate>Tue, 13 Dec 2022 17:33:42 +0000</pubDate>
      <link>https://forem.com/marcos_freitas_1742547f09/happy-seeding-with-faker-10n8</link>
      <guid>https://forem.com/marcos_freitas_1742547f09/happy-seeding-with-faker-10n8</guid>
      <description>&lt;p&gt;Learning Ruby as a backend language in the first couple of days, seemed "easy" enough to be true. Obviously its syntaxes and functionalities eventually caught up to me. It's amazing to learn the importance, understanding, and planning relationships between backend and frontend datas in order for you to trace your project's paths. Just like in the front end, the backend has a bunch of tools to help make your code more dynamic, cleaner, and more organized. Tools that can save you so much time writing backend data and focus more on your project creativity in the frontend. &lt;/p&gt;

&lt;p&gt;Having that in mind, the process of creating your backend data in the seeds.rb file, can be just as simple and easy as creating some random dummy data for a small project, or it can be harder and more time consuming trying to create extensive dummy data for a bigger project. &lt;/p&gt;

&lt;p&gt;Therefore, I will introduce you to "Faker". A Ruby gem that only works with ruby applications and generates fake information for a bunch of different things such as; names, addresses, games, movies, books, etc. This gem can and will save you a lot of time manually putting placeholder data into your seeds.rb file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Here are the steps to have your Ruby gem Faker installed:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 1&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Make sure you INSTALL (gem 'faker') in your Gemfile and run (bundle install) in your project's directory.&lt;/em&gt;&lt;/p&gt;

&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%2Fk52d5bdao9wpuborzoxr.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%2Fk52d5bdao9wpuborzoxr.png" alt="Installing gem 'faker'" width="800" height="941"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Or, another option would be to run (gem install faker) on your machine terminal.&lt;/em&gt;&lt;/p&gt;

&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%2Ffqrascocazeqjvx96lk8.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%2Ffqrascocazeqjvx96lk8.png" alt="Gem install faker" width="800" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 2&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Go to your seeds.rb file inside your db directory and add (require 'faker') on the top of your file.&lt;/em&gt;&lt;/p&gt;

&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%2Fhaaenbg06j3a2511d3vx.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%2Fhaaenbg06j3a2511d3vx.png" alt="Adding require 'faker'" width="800" height="941"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Presuming your tables are created and migrated, you can generate some "Faker" data with correct format to use in your projects.&lt;/p&gt;

&lt;p&gt;In your seeds.rb file, you have to set a time loop to the number of times you want to generate data. In this case, it is “5” for Earthling. The faker gem will create new random data for every field.&lt;/p&gt;

&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%2Frpij45k2nayfv88l5zmi.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%2Frpij45k2nayfv88l5zmi.png" alt="Faker gem data syntax" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you created a seeds.rb file containing all your data, do not forget to seed it! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In your terminal (project's directory) run:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;rake db:seed&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can check everything was seeded correctly by confirming your data is present within the rake console and run tests.&lt;br&gt;
For that all you need to do is in your project's directory run, &lt;strong&gt;&lt;em&gt;rake console&lt;/em&gt;&lt;/strong&gt; , then run tests. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;br&gt;
If no seed data shows up, see that you are meeting all validations in your models that may be prohibiting the data from being created in the first place.&lt;/p&gt;

&lt;p&gt;In case you need to create data that there are not specific in Faker generators, get creative with the ones that already exist. Most generators provide multiple methods for various types of, as well as unique data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Time is of essence and creating seed data can be a long and boring task, but it doesn't have to be anymore! Using this ruby Faker gem, writing seed data will be simpler, and faster. &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                 Happy Seeding!!! 🌱🌱🌱🌱
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;References&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/faker-ruby/faker" rel="noopener noreferrer"&gt;https://github.com/faker-ruby/faker&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/brewchetta/phase-3-practice-code-challenge-aliens-among-us" rel="noopener noreferrer"&gt;https://github.com/brewchetta/phase-3-practice-code-challenge-aliens-among-us&lt;/a&gt;&lt;/p&gt;

&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%2F470jgfqjsawvxv3y4te2.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%2F470jgfqjsawvxv3y4te2.png" alt="Faker gem" width="640" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>npm</category>
      <category>react</category>
      <category>sideprojects</category>
    </item>
    <item>
      <title>Vanilla JavaScript vs React (JSX)</title>
      <dc:creator>Marcos Freitas</dc:creator>
      <pubDate>Mon, 05 Dec 2022 16:20:09 +0000</pubDate>
      <link>https://forem.com/marcos_freitas_1742547f09/vanilla-javascript-vs-react-jsx-4ee</link>
      <guid>https://forem.com/marcos_freitas_1742547f09/vanilla-javascript-vs-react-jsx-4ee</guid>
      <description>&lt;p&gt;As a software engineer student, learning "Vanilla" JavaScript was more challenging to me than learning React (JSX). Through Vanilla JS, it was harder to build proper architecture, so code would not quickly break; and to deal with DOM updates, and searches. The reason why is because "vanilla" JavaScript does not have third-party libraries like (React) full of tools to make our lives easier, as the general structure is dictated by framework and developer just have to follow good practice.&lt;/p&gt;

&lt;p&gt;The UI (User interface) needs to be updated frequently and manually with Vanilla JS. React JS offers a fantastic feature as it has a virtual DOM, unlike Vanilla which breaks down the UI into smaller and reusable components. React (JSX) outperforms Vanilla JS regarding UI/UX (User interface/ User experience) performance because developers don't need to enter the DOM. It happens automatically.&lt;/p&gt;

&lt;p&gt;Due to applications getting more complex and dynamic, Facebook created React library to assist speeding the development process up. "It was first deployed on Facebook's News Feed in 2011 and later on Instagram in 2012. It was open-sourced at JSConf US in May 2013. React Native, which enables native Android, iOS, and UWP development with React, was announced at Facebook's React Conf in February 2015 and open-sourced in March 2015". Which means that, the code is designed to be publicly accessible to anyone so they can see, modify, and distribute the code as they see fit. Open source software is developed in a decentralized and collaborative way, relying on peer review and community production.&lt;/p&gt;

&lt;p&gt;React, also referred as (JSX - JavaScript XML); is an extension to the JavaScript language syntax. The combination of HTML and JS, allows us to write HTML-like code in our JS files.&lt;/p&gt;

&lt;p&gt;See below an example of the difference between "vanilla" JS and React JSX syntax. &lt;/p&gt;

&lt;p&gt;Vanilla JS being imperative which describes the actions a program should take, each step of the way and how a program should go about doing those actions&lt;/p&gt;

&lt;p&gt;React JSX being declarative which describes what a program should accomplish or its end result, and leaves the determination of how to get to the end result up to the program&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GiA_i9pE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fv3ksbr6chcd3h2xxyke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GiA_i9pE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fv3ksbr6chcd3h2xxyke.png" alt="Vanilla JS vs React JSX" width="880" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KtfuVoNO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0wvstivngrhq4iv7xy2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KtfuVoNO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0wvstivngrhq4iv7xy2.png" alt="Vanilla JS vs React JSX" width="880" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are some examples of the most influential software engineer languages and what they are being used for:&lt;br&gt;
( &lt;a href="https://bootcamp.berkeley.edu/blog/most-in-demand-programming-languages/"&gt;https://bootcamp.berkeley.edu/blog/most-in-demand-programming-languages/&lt;/a&gt; )&lt;/p&gt;

&lt;p&gt;In conclusion, React JSX was particularly easier to learn in comparison to Vanilla JS due to its powerful library tools. However, every new language takes time and consistency to be mastered and that is the final goal.&lt;/p&gt;

&lt;p&gt;Resources: &lt;a href="https://en.wikipedia.org/wiki/React_(JavaScript_library)#:%7E:text=It%20was%20first%20deployed%20on,open%2Dsourced%20in%20March%202015"&gt;https://en.wikipedia.org/wiki/React_(JavaScript_library)#:~:text=It%20was%20first%20deployed%20on,open%2Dsourced%20in%20March%202015&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://bootcamp.berkeley.edu/blog/most-in-demand-programming-languages/"&gt;https://bootcamp.berkeley.edu/blog/most-in-demand-programming-languages/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JavaScript Variables</title>
      <dc:creator>Marcos Freitas</dc:creator>
      <pubDate>Mon, 21 Nov 2022 17:12:53 +0000</pubDate>
      <link>https://forem.com/marcos_freitas_1742547f09/javascript-variables-a9i</link>
      <guid>https://forem.com/marcos_freitas_1742547f09/javascript-variables-a9i</guid>
      <description>&lt;p&gt;What is a variable in JavaScript? A variable is a location where you can store values (strings, number, boolean, etc) to be used later. After passing this data and storing in JavaScript engine, you can access it when needed. By assigning a name to our variable, we can tell the engine which specific stored data we want access. Variables' names must be unique identifiers and cannot be numbers, they must be in lower case unless it is made of multiple words then you can use camelCase.&lt;/p&gt;

&lt;p&gt;The main variables declarations are const, let, and var. The var declaration was the only one used in the past until the language update in 2015 adding const and let to variable declaration.&lt;/p&gt;

&lt;p&gt;JavaScript let statement: &lt;br&gt;
let x = 1;&lt;br&gt;
if (x === 1) {&lt;br&gt;
  let x = 2;&lt;br&gt;
  console.log(x);&lt;br&gt;
  // expected output: 2&lt;br&gt;
}&lt;br&gt;
console.log(x);&lt;br&gt;
// expected output: 1&lt;/p&gt;

&lt;p&gt;JavaScript const statement:&lt;br&gt;
const number = 42;&lt;br&gt;
try {&lt;br&gt;
  number = 99;&lt;br&gt;
} catch (err) {&lt;br&gt;
  console.log(err);&lt;br&gt;
  // expected output: TypeError: invalid assignment to const `number'&lt;br&gt;
  // Note - error messages will vary depending on browser&lt;br&gt;
}&lt;br&gt;
console.log(number);&lt;br&gt;
// expected output: 42&lt;/p&gt;

&lt;p&gt;JavaScript var statement:&lt;br&gt;
var x = 1;&lt;br&gt;
if (x === 1) {&lt;br&gt;
  var x = 2;&lt;br&gt;
  console.log(x);&lt;br&gt;
  // expected output: 2&lt;br&gt;
}&lt;br&gt;
console.log(x);&lt;br&gt;
// expected output: 2&lt;/p&gt;

&lt;p&gt;However, since the update, it is recommended for good practice not to use var and use const and let instead. Let is used when you know the value is going to change and const for other variables not changing value. &lt;br&gt;
It is better to use const because it prevents the variable to be assigned to another value. If the value changes later on, you can replace the value to let.&lt;/p&gt;

</description>
      <category>tailwindcss</category>
      <category>webdev</category>
      <category>css</category>
    </item>
    <item>
      <title>The Rollercoaster of Learning to Code</title>
      <dc:creator>Marcos Freitas</dc:creator>
      <pubDate>Mon, 14 Nov 2022 17:16:08 +0000</pubDate>
      <link>https://forem.com/marcos_freitas_1742547f09/the-rollercoaster-of-learning-to-code-2jg0</link>
      <guid>https://forem.com/marcos_freitas_1742547f09/the-rollercoaster-of-learning-to-code-2jg0</guid>
      <description>&lt;p&gt;As my first blog in the tech industry, I would like to start by sharing some personal feelings about it. It's what I call the rollercoaster of emotions.&lt;/p&gt;

&lt;p&gt;Like many other new techs, I'm also switching careers, from the construction industry over to something completely new and different from what I had done my entire life. Not to say every other steps and sacrifices one makes to commit to such an intense, but rewarding program. &lt;/p&gt;

&lt;p&gt;The excitement mixed with anxiety for the first day of class soon went away by having the pleasure of meeting a lot of nice people. Everyone there with similar goals and determination to learn to code and ace their dream job. Just by being part of this community is such a humbling experience. I'm lucky to have supportive instructors and cohort! What else could I ask for? &lt;/p&gt;

&lt;p&gt;However, even knowing I have such an amazing learning support, and enjoyed what I have learned so far; the "Imposter Syndrome", something I learned in Phase One, comes and goes without a warn. And that is what has been the hardest to me to deal with it. It's hard not to overthink just a bit sometimes, and watch movies play and re-play over and over again in your head. I feel it's because you care enough about it. And like it or not, unfortunately learning something new requires getting out of your comfort zone; it has its ups and downs where you enjoy what you are learning until it becomes too hard, or you get stuck in the "rabbit hole". &lt;/p&gt;

&lt;p&gt;I hope that sharing some personal feelings here does not scare anybody away and can help anybody else dealing with it. As a wise man once said: "It's a marathon that you're running, not a 5k race". I'm focused on the main goal and I know it's doable. I'm looking forward to learn and grow as a software engineer.  &lt;/p&gt;

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