<?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: Ariel Davis</title>
    <description>The latest articles on Forem by Ariel Davis (@arieldavis22).</description>
    <link>https://forem.com/arieldavis22</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%2F349773%2F2a5f408b-4880-454e-ad03-2c2c616699dd.png</url>
      <title>Forem: Ariel Davis</title>
      <link>https://forem.com/arieldavis22</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/arieldavis22"/>
    <language>en</language>
    <item>
      <title>Venturing into Freelancing: My Story</title>
      <dc:creator>Ariel Davis</dc:creator>
      <pubDate>Sat, 26 Aug 2023 22:19:34 +0000</pubDate>
      <link>https://forem.com/arieldavis22/venturing-into-freelancing-my-story-5d42</link>
      <guid>https://forem.com/arieldavis22/venturing-into-freelancing-my-story-5d42</guid>
      <description>&lt;h2&gt;
  
  
  Hello,
&lt;/h2&gt;

&lt;p&gt;I'm &lt;a href="https://arieldavis.webflow.io/"&gt;Ariel Davis&lt;/a&gt;, and right now, I'm working as a Webflow freelancer. Before this, I spent about three years as a software engineer. I made the switch to freelancing in March of this year. In the last six months, I've gone from feeling uncertain about my programming career to not knowing when my next client will come along. I'm still new to this, so I appreciate your patience as I share how I got here. And who knows, maybe my journey will inspire some of you. Trust me, it's quite the adventure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zQoMfQ1b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bfjt6a1d6jmiwcryrqu4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zQoMfQ1b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bfjt6a1d6jmiwcryrqu4.jpg" alt="Pink HTML closing tag" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Day 0 - Taking a Big Step
&lt;/h2&gt;

&lt;p&gt;Since I had experience as a software engineer, this change wasn't too crazy. But looking back, I could have handled it better. After I left my last job, finding a new one was tougher than I thought, even with all my experience. I applied for jobs like crazy, sometimes hundreds in a week, but nothing worked out. And the few interviews I did get didn't go well. It was tough, but I started to see it as a sign. A sign that what I was doing:&lt;br&gt;
A. Wasn't working&lt;br&gt;
and B. Wasn't making me happy.&lt;/p&gt;

&lt;p&gt;So, I decided to switch things up. I still loved programming, but if the usual job route wasn't working, I was going to take matters into my own hands and start freelancing!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hG1MrOkO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ch47cgaujrjggu34hcq1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hG1MrOkO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ch47cgaujrjggu34hcq1.jpg" alt="Computer on a desk that reads do more" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Learning First, Doing Second
&lt;/h2&gt;

&lt;p&gt;First, I want to give a shout-out to Vako Shvili. His Udemy course "&lt;a href="https://www.udemy.com/share/102FgU3@0_8Yf2SqAMuAkfZltQEChRtx9HJarFqdOOxJ8EliCCbWLIH1YwVRN5G9cgmxuse0/"&gt;Complete Web Design: from Figma to Webflow to Freelancing&lt;/a&gt;" is amazing. He takes you through everything step by step, using projects to teach you the basics of Webflow and Figma really quickly. If you're even a bit interested in this field, I totally recommend his course – that's where I got my start.&lt;/p&gt;

&lt;p&gt;During this course, I realized that even though I'd been a developer for a while, I knew nothing about design. I couldn't make a website look... well, good. This realization was a big moment for me. I learned about Figma, why certain fonts look better, how colors work together – it was like a whole new world. And when I started using Webflow, that's when things got even more exciting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--saVwBYD0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mniala8p1icduofz6e1p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--saVwBYD0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mniala8p1icduofz6e1p.png" alt="Webflow professional partner" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Webflow Magic
&lt;/h2&gt;

&lt;p&gt;I'd heard of other website builders like WordPress and Shopify, but Webflow was new to me. Even before I learned all the details, I had a feeling it would become my favorite way to make websites. If you're thinking about learning Webflow, check out their free &lt;a href="https://university.webflow.com/courses/webflow-101"&gt;Webflow 101&lt;/a&gt; course. It's designed for beginners, so you don't need years of experience to get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking Ahead
&lt;/h2&gt;

&lt;p&gt;Having my past experience helped me learn Webflow faster, which helped me find my first clients more quickly. I'm testing the waters on Upwork, and I'm aiming to become a certified Webflow Expert soon. That should open up more opportunities with clients. If you've read this far, thank you! Feel free to explore my &lt;a href="https://arieldavis.webflow.io/"&gt;portfolio website&lt;/a&gt;, and if you're looking for a Webflow developer, send me a message.&lt;/p&gt;

&lt;p&gt;Stay tuned for more to come…"&lt;/p&gt;

</description>
      <category>webflow</category>
      <category>webdev</category>
      <category>freelance</category>
      <category>design</category>
    </item>
    <item>
      <title>Expecting the Unexpected: Javascript Throw &amp; Catch</title>
      <dc:creator>Ariel Davis</dc:creator>
      <pubDate>Wed, 06 May 2020 20:04:21 +0000</pubDate>
      <link>https://forem.com/arieldavis22/expecting-the-unexpected-javascript-throw-catch-beb</link>
      <guid>https://forem.com/arieldavis22/expecting-the-unexpected-javascript-throw-catch-beb</guid>
      <description>&lt;h1&gt;
  
  
  Error Handling
&lt;/h1&gt;

&lt;p&gt;Error's are and will always be a big part of a developers life. They are what allow us to see what mistakes we made in out code, and learn more and more about what's going on behind the scenes. Sometimes however, we expect to get back and error from the code we've written. We need a way to handle this situation. This is where Error Handling comes into play.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flatiron School
&lt;/h3&gt;

&lt;p&gt;I am Ariel Davis, a current student at Flatiron School. I've come across error handling without going into too much detail a lot throughout my time at this school. After sitting down to really get an understanding of when to use error handling has been of great use to me and I can only hope it will be of great use to you as well. In this blog, I will go over when, why, and how, to use error handling in Javascript.&lt;/p&gt;

&lt;h3&gt;
  
  
  When?
&lt;/h3&gt;

&lt;p&gt;When is it a good time to use error handling? There will be many times while programming when you come across an error. You shouldn't have the mindset of, "Oh there's an error, let me use error handling". Rather you should think like, "I know there are set conditions that would make this throw an error, so let me handle it." You should only use error handling when an error is expected to happen based off of certain conditions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why?
&lt;/h3&gt;

&lt;p&gt;Why we should use error handling ties close to when we should use them. When your program throws an error that you are expecting, it will more than likely crash and burn. We don't want this to happen while our application is being used so we throw and catch an error.&lt;/p&gt;

&lt;h3&gt;
  
  
  How?
&lt;/h3&gt;

&lt;p&gt;The bread and butter of this blog. How exactly do we work with error handling? In Javascript we use what's called the try...catch syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="c1"&gt;//Some code that may throw an error&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="c1"&gt;//Some code that happens if/when an error occurs&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code in &lt;code&gt;try{..}&lt;/code&gt; is what is initially ran in your program.&lt;br&gt;
Depending on if this piece of code throws an error or not, the next block of code &lt;code&gt;catch(error) {...}&lt;/code&gt; is ran.&lt;br&gt;
For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Super cool console.log&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This console log won't run&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;undefinedVar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This console log will now run&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the variable &lt;code&gt;undefinedVar&lt;/code&gt; isn't defined, an error is thrown. Now normally this would end the program, but with the error handling in place, the program will continue and run the console.log:&lt;br&gt;
&lt;code&gt;console.log("This console log will now run")&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Basics
&lt;/h3&gt;

&lt;p&gt;That is the basic concept of error handling, some nice resources that can be used in order to get a different explanation of the try...catch syntax can be found at these links:&lt;br&gt;
&lt;a href="https://javascript.info/try-catch"&gt;Try and Catch Article&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch"&gt;MDN Docs&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/js/js_errors.asp"&gt;W3Schools&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>fetch</category>
      <category>errors</category>
    </item>
    <item>
      <title>JavaScript: Playing Fetch With Data</title>
      <dc:creator>Ariel Davis</dc:creator>
      <pubDate>Tue, 14 Apr 2020 17:23:59 +0000</pubDate>
      <link>https://forem.com/arieldavis22/javascript-playing-fetch-with-data-1c62</link>
      <guid>https://forem.com/arieldavis22/javascript-playing-fetch-with-data-1c62</guid>
      <description>&lt;p&gt;Hello fellow full stack developers. In this blog post I will be discussing an important topic. Yes this topic is about using JavaScript to be able to communicate with that super cool data in your backend. Let's get started.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For this blog, we will be using Ruby (Ruby on Rails) as our backend and JavaScript as our frontend.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why?
&lt;/h2&gt;

&lt;p&gt;Why would I want to get data from my backend and manipulate it on my frontend..ew? Well not ew. In this day in age, we want to have dynamic applications that give users a grand experience. We don't want stale, static applications that don't change. This is why we use and manipulate data (our backend) so that we can make and persist changes on the fly. Today, we will just be looking at how to &lt;strong&gt;"GET"&lt;/strong&gt; that data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;So I'm going to assume you already have a backend database that you would like to work with (using Rails as your API), and your here to find out how to connect it to your frontend and work with that data. Cool? Cool.&lt;/p&gt;

&lt;p&gt;Once you have your super cool Rails database that you are ready to work with, do ahead and start up your server. Check out that data that you are gonna work with.&lt;/p&gt;

&lt;p&gt;(This will be at the &lt;strong&gt;INDEX&lt;/strong&gt; route sticking to restful routes, that should already be set up)&lt;/p&gt;

&lt;p&gt;Usually this data will be at: &lt;br&gt;
&lt;code&gt;http://localhost:3000/#{some_cool_thing}&lt;/code&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FZqRwd23--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0ygbbr9mpl4sylobimm1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FZqRwd23--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0ygbbr9mpl4sylobimm1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yay some nice data. But how do we get this data in out frontend. Well lets move over to a JS file we've named &lt;code&gt;index.js&lt;/code&gt;&lt;br&gt;
We are going to use this file to get that super crazy amazing cool data from our database, this is where &lt;strong&gt;FETCH&lt;/strong&gt; comes into play!&lt;/p&gt;

&lt;h2&gt;
  
  
  Fetch
&lt;/h2&gt;

&lt;p&gt;Inside of your &lt;code&gt;index.js&lt;/code&gt; file--&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V7HsCf7c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8ptz72cladl456vkp5du.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V7HsCf7c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8ptz72cladl456vkp5du.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
(as a side note, make sure that this file is linked to you HTML file with script tags) &lt;/p&gt;

&lt;p&gt;We are going to write the word that will allow you to unlock your data. That word..fetch.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hYnY61ku--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9cghio9fyrm3p93rdx51.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hYnY61ku--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9cghio9fyrm3p93rdx51.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cool. We're done.&lt;/p&gt;

&lt;p&gt;Just kidding. This method however, is the key to getting out data from our back end. The fetch method takes two arguments. The first is a URL (Yes! For those who guessed, our &lt;strong&gt;database URL&lt;/strong&gt;) and the second is an object (we wont worry about that right now). What we are going to do is put the URL of our database as the first argument in the fetch method(as a string).&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--59jNCvoH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/i2wx9h0yap3d721nzv5z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--59jNCvoH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/i2wx9h0yap3d721nzv5z.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
If we were to &lt;code&gt;console.log()&lt;/code&gt; this we would get the following in return:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t38XAnCG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hea2fizchonouj8fbhif.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t38XAnCG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hea2fizchonouj8fbhif.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
What is this weird thing..a &lt;strong&gt;"Promise"&lt;/strong&gt;. This isn't the data that we want back. Well essentially a &lt;code&gt;Promise&lt;/code&gt; is JavaScripts way of telling us that we have the data that you want and we are definitely going to give it to you, just not yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  .then and a Response
&lt;/h2&gt;

&lt;p&gt;So what can we do with this Promise to get the data that we need? Well once we get this response &lt;code&gt;.then&lt;/code&gt; we want to get our response. If you got the hint, we are goin got use &lt;code&gt;.then&lt;/code&gt; on our fetch. This will give us back a response.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X5j4Bv2j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/i4enpyvqli0k9pymbvpg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X5j4Bv2j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/i4enpyvqli0k9pymbvpg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
If we console log this we get back:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n1xTf0wo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ixwdanxboh49cpzy4gh7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n1xTf0wo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ixwdanxboh49cpzy4gh7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this response we need to be able to convert it into some usable data.  JSON data to be specific. We take the response that we got and parse it into a JSON format with &lt;code&gt;.json()&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fsiGjsL6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1zn4ra2zts5iqxjk58n0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fsiGjsL6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1zn4ra2zts5iqxjk58n0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Data!
&lt;/h2&gt;

&lt;p&gt;Great we are almost there! With this &lt;strong&gt;new Promise&lt;/strong&gt; (console log what we just did, we get back a promise again) we can &lt;code&gt;.then&lt;/code&gt; get back the data we need. Got the hint again? We use &lt;code&gt;.then&lt;/code&gt; again, but this time we get back:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iwWmH-fc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vvbto9rl3rv5bvf302uo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iwWmH-fc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vvbto9rl3rv5bvf302uo.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
In the console:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDJ9l_t6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/j5404n0c828byj28bpav.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDJ9l_t6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/j5404n0c828byj28bpav.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
We get back and Array of Data!&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
We can use this data now in different methods and functions in order to manipulate it to our liking. This is just the beginning to getting our data and using it. We can make &lt;strong&gt;POST&lt;/strong&gt;, &lt;strong&gt;PATCH&lt;/strong&gt;, and &lt;strong&gt;DELETE&lt;/strong&gt; request using fetch that further expand our super coding abilities. For now though, this is how you FETCH data in JavaScript.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>fetch</category>
      <category>flatiron</category>
      <category>database</category>
    </item>
    <item>
      <title>Simple Weighted Random Number</title>
      <dc:creator>Ariel Davis</dc:creator>
      <pubDate>Tue, 24 Mar 2020 19:51:56 +0000</pubDate>
      <link>https://forem.com/arieldavis22/simple-weighted-random-number-5g2k</link>
      <guid>https://forem.com/arieldavis22/simple-weighted-random-number-5g2k</guid>
      <description>&lt;h1&gt;
  
  
  Flatiron Student
&lt;/h1&gt;

&lt;p&gt;I am currently on my 6th week at Flatiron School and I've it has been a roller coaster for sure. It is project week for us and a problem that I was facing in my project was working with probability. Now probability when working with Ruby (or from my research ANY language) can be either simple..or complicated enough to make you want to throw your laptop..needless to say..I almost threw my laptop.&lt;/p&gt;

&lt;h1&gt;
  
  
  Simple Stupid
&lt;/h1&gt;

&lt;p&gt;I want to share with you my simple way to work with weighted random numbers (probability). Now as a disclaimer this is &lt;strong&gt;NOT THE MOST EFFICIENT METHOD TO WORKING WITH WEIGHTED RANDOM NUMBERS&lt;/strong&gt;. This post is for a simple solution that has limited application.&lt;/p&gt;

&lt;h1&gt;
  
  
  More Than One Means
&lt;/h1&gt;

&lt;p&gt;The basis of this solution to working with weighted probability is the following:&lt;br&gt;
&lt;strong&gt;The more the are, the more likely it will get picked&lt;/strong&gt;&lt;br&gt;
If I had the following array:&lt;br&gt;
&lt;code&gt;arr = ["test1", "test2", "test1", "test1"]&lt;/code&gt;&lt;br&gt;
and were to run the following method:&lt;br&gt;
&lt;code&gt;arr.sample&lt;/code&gt;&lt;br&gt;
There would be a greater chance that &lt;code&gt;test1&lt;/code&gt; will be chosen from the &lt;code&gt;.sample&lt;/code&gt; method.&lt;/p&gt;

&lt;h1&gt;
  
  
  Not DRY at all
&lt;/h1&gt;

&lt;p&gt;This can lead to a lot of repetition in your code so to be honest I'd stay away from using something like this unless you were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Working with a very small amount of data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it. Don't use this unless you're working with a small amount of data.&lt;/p&gt;

&lt;p&gt;I will definitely continue to do more research in working with this and come back with a more advance way of working with weighted probability and make it as understanding as I can. Until then..&lt;/p&gt;

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