<?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: Angela Lam</title>
    <description>The latest articles on DEV Community by Angela Lam (@anglam).</description>
    <link>https://dev.to/anglam</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%2F516622%2F8034ab8f-92d1-4a16-ad47-d4136fdf3b27.jpeg</url>
      <title>DEV Community: Angela Lam</title>
      <link>https://dev.to/anglam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anglam"/>
    <language>en</language>
    <item>
      <title>Recommend A  Coding Podcast</title>
      <dc:creator>Angela Lam</dc:creator>
      <pubDate>Mon, 15 Nov 2021 00:41:55 +0000</pubDate>
      <link>https://dev.to/anglam/recommend-a-coding-podcast-3k59</link>
      <guid>https://dev.to/anglam/recommend-a-coding-podcast-3k59</guid>
      <description>&lt;p&gt;Being a newbie to coding, I recently dived into the coding podcast hole. There are technology and terminologies that I don't understand or need more information about, but it's hard to read or find that information. I believe that podcasts about coding will help and guide me in the tech field. Below are some of the podcasts that I am current or have listened to:&lt;/p&gt;

&lt;h3&gt;
  
  
  CodeNewbie
&lt;/h3&gt;

&lt;p&gt;CodeNewbie has been my favorite coding podcast so far. The podcast focuses on guest's coding journey. &lt;/p&gt;

&lt;h5&gt;
  
  
  How to transition into development after over a decade in your field (S17:E6)
&lt;/h5&gt;

&lt;p&gt;I found this episode to be pretty relatable. I've been in my field for over 5 years now and I'm trying to make the switch over to tech. Hearing a nurse talk about graduating from a bootcamp and entering the tech field gave me hope and I ended the episode with new insight and advice. &lt;/p&gt;

&lt;h5&gt;
  
  
  What you should know about frontend development (S16:E8)
&lt;/h5&gt;

&lt;p&gt;While looking for a job, I'm debating whether I want a frontend, backend, or full-stack position. Listening to this episode gave me some insight on what a frontend developer does, which was very enlightening.&lt;/p&gt;

&lt;h5&gt;
  
  
  What failing technical interviews can teach you (S16:E6)
&lt;/h5&gt;

&lt;p&gt;As someone who is actively applying for jobs right now, but I haven't had an interview yet, I'm nervous as heck about my first tech interview. Listening to someone with a CS degree and background talk about failing interviews and struggling really helped me get some "peace of mind." Tech interviews aren't easy, even for CS majors, so I shouldn't stress TOO much.&lt;/p&gt;

&lt;h3&gt;
  
  
  Learn to Code in One Month
&lt;/h3&gt;

&lt;p&gt;Learn to Code in One Month is a podcast for beginners who want to learn to code, but don’t know where to start. &lt;/p&gt;

&lt;h5&gt;
  
  
  Front-end vs Back-end Developers | What's the difference?
&lt;/h5&gt;

&lt;p&gt;Similar to the CodeNewbie episode, "What you should know about frontend development", this episode allowed me to get some insights on frontend vs backend developing. &lt;/p&gt;

&lt;h5&gt;
  
  
  How I Got Hired at GitHub, Interview Tips, and Salary Negotiation with Joel Califa
&lt;/h5&gt;

&lt;p&gt;This episode did not give me a lot of tips or insights, but I did thoroughly enjoyed the episode. The episode allowed me to hear a journey that wasn't similar to mine at all. It gave me more perspective about the tech field.&lt;/p&gt;

&lt;h3&gt;
  
  
  Recommendations?
&lt;/h3&gt;

&lt;p&gt;I just dipped my feet in the coding podcast water, so I would love any recommendations for another coding podcast. I still have a lot to learn and podcasts are a great way to do that. Please comment below some of your favorite podcasts!&lt;/p&gt;

</description>
      <category>podcast</category>
    </item>
    <item>
      <title>Dev Job Starting Line</title>
      <dc:creator>Angela Lam</dc:creator>
      <pubDate>Sun, 07 Nov 2021 06:26:05 +0000</pubDate>
      <link>https://dev.to/anglam/dev-job-starting-line-3dme</link>
      <guid>https://dev.to/anglam/dev-job-starting-line-3dme</guid>
      <description>&lt;p&gt;Where does one start when looking for a job? In my current field of bio-research, I would look at jobs online or get referrals for a job of interest. Now that I'm looking for a job as a software developer, I'm not sure where or how to begin.&lt;/p&gt;

&lt;p&gt;It's been almost two months since I graduated from my Software Engineer bootcamp. During that time, I worked with my career coach to draft a good resume, tweak my LinkedIn, and do a mock interview. Now that I've officially declared the start of my job search with my coach, the anxiety is really kicking in. I knew it wouldn't be easy, but there's so much to learn for a tech interview that I don't know where to start. Below are my thoughts on some of the main aspects of a dev job hunt:&lt;/p&gt;

&lt;h3&gt;
  
  
  Learning DS&amp;amp;A
&lt;/h3&gt;

&lt;p&gt;Data structures and algorithms are the bane of my existence. Don't get me wrong! I love solving code problems since they remind me of puzzles and I learn new algorithms. Bootcamp didn't really cover that part during the curriculum. After graduation, they threw a link at me with some resources and that was it. The real struggle is learning all the different data structures, such as recursion and binary trees, while learning the best algorithms to solve them. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Just do Leetcode problems" - Everyone&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I find it hard to solve Leetcode problems with no knowledge of data structures. AlgoExpert is a site that has really helped me out. AlgoExpert is not free, but it gives you 160 coding questions to ace the coding interviews with video explanations and additional interview resources. As someone with no past experience with Leetcode, AlgoExpert's problems and explanation have really helped. I highly recommend AlgoExpert if you're just starting data structure and algorithms.&lt;/p&gt;

&lt;h3&gt;
  
  
  Networking
&lt;/h3&gt;

&lt;p&gt;My coach and everyone I know advocate that networking is the most important part of finding a dev job. Cold applying to jobs is a black hole without a referral. Most of my time is spent on searching people on LinkedIn and messaging them. Connection is key for finding a job, but my main goal, as of now, is to connect and ask people how their job search journey went.&lt;/p&gt;

&lt;h3&gt;
  
  
  Applying for Jobs
&lt;/h3&gt;

&lt;p&gt;You would think applying for job is the easiest thing to do, but it's actually pretty difficult. The job description for each Software Engineer role can differ vastly from one another. It's hard to know what I want to do in a role when I haven't experienced a tech job before. &lt;/p&gt;

&lt;h3&gt;
  
  
  The Race
&lt;/h3&gt;

&lt;p&gt;This blog post is my starting line. It's really here to keep me accountable and motivated during my journey. &lt;/p&gt;

&lt;h6&gt;
  
  
  Daily Goals
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;At least two Leetcode problems&lt;/li&gt;
&lt;li&gt;Network with 2-4 people&lt;/li&gt;
&lt;li&gt;Apply to one job&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to give me tips and advice! I would greatly appreciate them!&lt;/p&gt;

</description>
      <category>motivation</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>My Journey through Bootcamp</title>
      <dc:creator>Angela Lam</dc:creator>
      <pubDate>Thu, 09 Sep 2021 07:15:45 +0000</pubDate>
      <link>https://dev.to/anglam/my-journey-through-bootcamp-4gpd</link>
      <guid>https://dev.to/anglam/my-journey-through-bootcamp-4gpd</guid>
      <description>&lt;p&gt;For the past ten months, I have been enrolled in Flatiron's online part-time software engineering course. This blog post marks my completion of my final project in Flatiron and the beginning of my job hunt in the tech field. Throughout my time in bootcamp, I've been asked by many how my bootcamp experience was and some showed interest in joining a bootcamp as well. Today, I'm going to share my experience and honest opinion about the curriculum. &lt;/p&gt;

&lt;p&gt;I want to note that I have very close people who have gone through the in-person flatiron curriculum that takes four months to complete, so there will be some comparing and contrasting to that curriculum.&lt;/p&gt;

&lt;p&gt;The part-time program is essentially two one-hour lectures and one pod meeting (a small group of students solving problems or asking questions with the instructor) per week including a bunch of labs/modules to complete on Canvas. From my friend who graduated from the on-campus full-time course, they had to be in class from 8am to 5pm (not exactly sure about the exact time, but basically from waking up to late afternoon). When I first heard about her curriculum, I thought I was got the bad end of the stick. She was definitely going to have a better curriculum than my part-time curriculum. But that wasn't the case... I think. It's hard to exactly compare and contrast the full-time on-campus to the part-time online. Overall, I think I learned just as much as the full-time on-campus students in regards to the languages and coding. Although the curriculum should be similar, there are some pros and cons about each.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full-time on-campus&lt;/strong&gt;&lt;br&gt;
Pros:&lt;br&gt;
-Pair-programming for projects&lt;br&gt;
-Code-challenge&lt;br&gt;
Cons:&lt;br&gt;
-Less requirements for projects&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part-time online&lt;/strong&gt;&lt;br&gt;
Pros:&lt;br&gt;
-Stricter on project&lt;br&gt;
-Live code challenge for project&lt;br&gt;
Cons:&lt;br&gt;
-No pair-programming&lt;/p&gt;

&lt;p&gt;For the full-time on-campus, they must pass a code-challenge about the material they learned. After passing, they start on projects which are actually done in pairs, so they get to collaborate and learn how to merge branches and make pull requests. I hate to admit it, but I barely know anything about pair-programming. The part-time online course is all about you and yourself. The projects are solo projects, which forces you to learn everything and solve all your bugs on your own without a partner. This is great but also stressful. After completing your project, you have a review where you are asked general questions about the material and your project, then the reviewer gives you a live-coding challenge on the spot. When I discussed project requirements with my friend who was enrolled in the full-time on-campus (but technically online because &lt;em&gt;covid&lt;/em&gt;), he had it way easier than I did. He had an easier rubric than the part-time online course. I honestly see this as a pro for me, since a stricter requirement for projects would force me to learn more and make a better application. Honestly, the only thing I'm salty about is the lack of pair-programming in the part-time online course. Unsure how the full-time online course runs. &lt;/p&gt;

&lt;p&gt;Overall, my experience with Flatiron has been great. I've connected with some of my fellow cohort students and became friends. The curriculum is not lacking and learned a lot about Ruby, Ruby on Rails, Javascript, React, and Redux. The only negative thing I have to say is the lack of pair-programming. Learning how to code with a fellow programmer is so important in the real world. When you head into a job, you're not going to be building your own application from the ground up. I do recommend Flatiron, whether it's the full-time on-campus or the part-time online. &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Self-Referential Association with Rails and React</title>
      <dc:creator>Angela Lam</dc:creator>
      <pubDate>Wed, 25 Aug 2021 07:38:53 +0000</pubDate>
      <link>https://dev.to/anglam/self-referential-association-with-rails-and-react-1824</link>
      <guid>https://dev.to/anglam/self-referential-association-with-rails-and-react-1824</guid>
      <description>&lt;p&gt;Imagine an application similar to LinkedIn, minus the job postings and resume profiles, with a focus on the tech field. My react-redux project was aiming for something like that, but probably isn't what you imagined. With this being my first react focused application, I wanted to focus on the basics, but also challenge me to do something new. I've never implemented a following or friending component to any of my applications before. This was a new skill for me to learn using a Rails API for my backend and React-Redux for my frontend, and I want to share the information for those who want to implement a following component in their application.&lt;/p&gt;

&lt;p&gt;First thing is creating a User model/table that with the attributes desired. We want an instance of User to be able to follow another instance of User. How we will achieve that is making a JOIN model. For my application, I called the JOIN model "Connection," which has a follower_id and a followed_id to join two users IDs. This is self-referential association, which links another model, in this case User to itself. This allows a user to follow many users and can be followed by many users. Here's how to code will look like in each of the models' class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#user.rb
class User &amp;lt; ApplicationRecord
    has_many :followed_users, foreign_key: :follower_id , class_name: "Connection"
    has_many :followed, through: :followed_users

    has_many :following_user, foreign_key: :followed_id, class_name: "Connection"
    has_many :followers, through: :following_user
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the first line, we’re saying that a user can have many followed_users, meaning that they can follow as many people as they want. We’re going to use the foreign key follower_id to represent these followed_users and this can be found in the Connection class. The second line of code is exactly what you’d expect to see in any has_many_through relationship. We’re saying that we have many followed through the followed_users that we’ve defined above.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#connection.rb
class Connection &amp;lt; ApplicationRecord
    belongs_to :follower, class_name: "User"
    belongs_to :followed, class_name: "User"
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The JOIN model belongs to a follower and a followed; those are a type of User, which is why we need to use class_name to state that they are from the class User. &lt;/p&gt;

&lt;p&gt;After getting the associations working on the backend, I had to think of a way to get all Users into my redux store in my front end with all the associations. I didn't want to make a fetch request to both my Users AND my Connections. Fetches are asynchronous and not very optimal to make multiple fetch requests. If I checked my rails server in &lt;code&gt;http://127.0.0.1:3000/users&lt;/code&gt;, I would find the following User object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "id": 1,
    "firstName": "Angela",
    "lastName": "Lam",
    "email": "angela@email.com"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Of course I want the User object, therefore I would make a fetch request to that URL and get all my users. How about my connections, which tell me the follower/following between User instances? I could create a fetch request to &lt;code&gt;http://127.0.0.1:3000/connections&lt;/code&gt; and get something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "id": 1,
    "followed_id": 1,
    "follower_id": 5,
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But now I would have to find the Users that match the IDs in the Connection instance. Thankfully, Rails allows us to easily include related models in a controller action.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class UsersController &amp;lt; ApplicationController
  # GET /users
  def index
    users = User.all
    render json: users, include: [:followers, :followed]
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the index action, the line where I render json of User.all, I use the include option to indicate that I want to nest followers and followed. This produces a JSON like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "id": 5,
    "firstName": "Anna",
    "lastName": "Kim",
    "email": "anna@email.com"
    "followers": [
      {
        "id": 2,
        "firstName": "Bob",
        "lastName": "Smith",
        "email": "bob@email.com"
      },
      {
        "id": 1,
        "firstName": "Angela",
        "lastName": "Lam",
        "email": "angela@email.com"
      }
    ],
    "followed": [
      {
        "id": 1,
        "firstName": "Angela",
        "lastName": "Lam",
        "email": "angela@email.com"
      }
    ]
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All attributes of included objects will be listed by default and the related models are rendered and nested in the JSON data. In the JSON data above, we can see that Anna follows Angela and Anna is followed by Angela and Bob. Now on my frontend, I can fetch this JSON data and easily reference the users following a particular User and the users that the particular User follows. This is one less fetch request to perform for my application, and I get to keep associations together in one object. I can simply userObj.followers and userObj.followed to get the arrays of all the Users whom follow or are followed by the userObj.&lt;/p&gt;

&lt;p&gt;Hopefully this article helps anyone who is trying to work with React or JavaScript with a Rails API. This method will let you implement a following/follower component to your app and allow your User model to have self-referential association, allowing Users to have many relationships between other Users. The include option works great with a simple User model, but if you have complicated attributes that you want to include/exclude, you should take a look at Serializers, which is something I might cover in the future, but not today.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>redux</category>
      <category>rails</category>
    </item>
    <item>
      <title>Road from Ruby to JavaScript </title>
      <dc:creator>Angela Lam</dc:creator>
      <pubDate>Sat, 03 Jul 2021 07:43:16 +0000</pubDate>
      <link>https://dev.to/anglam/road-from-ruby-to-javascript-1nfk</link>
      <guid>https://dev.to/anglam/road-from-ruby-to-javascript-1nfk</guid>
      <description>&lt;p&gt;I've spent the first six months learning Ruby and becoming a Rails developer at Flatiron. The next challenge was to dive into JavaScript. The past two months of JavaScript has been a struggle for me. Manipulating the DOM and eventListeners were all new to me. Entering JavaScript, I definitely see why it's great for building a web application compared to what I have been doing with Rails. Honestly, I'm still learning a lot and need to work harder to become a better JavaScript developer. While working on my first project, building a JavaScript single-page application with a Rails API, I learned a lot of tips and tricks that hopefully will help some other beginners, like me, getting into JavaScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  for...in vs for...of
&lt;/h3&gt;

&lt;p&gt;For...in and for...of are two useful iterators that you need to know. For...in is used for objects, while for...of is used for arrays.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (variable in object) {
  statement
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The for...in statement iterates a specified variable over all the enumerable properties of an object. The statement will execute for every property in the 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 object = { a: 1, b: 2, c: 3 };

for (const property in object) {
  console.log(`${property}: ${object[property]}`);
}

// expected output:
// "a: 1"
// "b: 2"
// "c: 3"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example above, we are iterating through the object and console logging the property and its name. This is a great iterator to use if you want to grab properties from an object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (variable in object) {
  statement
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The for...of statement iterates through iterable objects, mainly arrays. The statement will execute for each element of an array. On each iteration a value of a different property is assigned to variable. Variable may be declared with const or let.&lt;br&gt;
&lt;/p&gt;

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

for (const element of array1) {
  console.log(element);
}

// expected output: "a"
// expected output: "b"
// expected output: "c"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  innerText vs innerHTML
&lt;/h3&gt;

&lt;p&gt;While building my project, I had to clear and add things to divs or elements. In order to do that, I had to access the innerHTML or innerText of an element. It's important to know the difference between these two methods.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div id='example'&amp;gt;
   &amp;lt;strong&amp;gt;This sentence is bold!&amp;lt;/strong&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The sample code, when rendered on a page will be displayed like this:&lt;br&gt;
This sentence is &lt;strong&gt;bold!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;element.innerText&lt;/code&gt; and &lt;code&gt;element.innerHTML&lt;/code&gt;, we can see what we get from the example code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const sentence = document.getElementById('example')
sentence.innerText

// =&amp;gt; "This sentence is bold!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;innerText retrieves and sets the content of the tag as plain text. It returns the string inside the div with no HTML formatting. Use innerText when you want to see what's inside an element with no formatting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const sentence = document.getElementById('example')
sentence.innerHTML

// =&amp;gt; &amp;lt;strong&amp;gt;This sentence is bold!&amp;lt;/strong&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;innerHTML retrieves and sets the same content in HTML format. This returns the string inside the div with the HTML markup, including any spacings or line breaks. When you want to see the HTML markup and what exactly is in our element.&lt;/p&gt;

&lt;h3&gt;
  
  
  == vs ===
&lt;/h3&gt;

&lt;p&gt;Ruby being my first language, I used &lt;code&gt;==&lt;/code&gt; all the time to compare things. I have to say I was weirded out by &lt;code&gt;===&lt;/code&gt; in Javascript. It's just so unnecessarily long-looking and I have to do an additional key stroke. JavaScript has both &lt;code&gt;==&lt;/code&gt; and &lt;code&gt;===&lt;/code&gt;, but it's better to use &lt;code&gt;===&lt;/code&gt;. The double equals operator is an abstract comparison and the triple equals operator is a strict comparison.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const a = 2
const b = 2

a == b
// =&amp;gt; true

a === b
// =&amp;gt; true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, both comparison operators return true, so what is the difference?&lt;/p&gt;

&lt;p&gt;The double equals operator converts the variable values to the same type before comparing, while the triple equals operator has no type conversion and returns true only if both values AND types are identical.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const a = 2
const b = 2
const c = "2"

a == b
// =&amp;gt; true

a === b
// =&amp;gt; true

a == c
// =&amp;gt; true

a === c
// =&amp;gt; false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the same example from before, but adding a new variable that is 2 similar to a and b, but it's a string instead of an integer. &lt;code&gt;a == c&lt;/code&gt; returns true because both variables contain the same value even though they have different types. The double equals operator is converting the two variables to the same data type and then comparing the value. &lt;code&gt;a === c&lt;/code&gt; returns false because the types of variables are different even though the value are the same. Overall, the triple equals operator is often used more than the double equals operator due to it's strict comparison of datatype and value making it a better and more accurate comparison.&lt;/p&gt;

&lt;h3&gt;
  
  
  Still a JavaScript Noob
&lt;/h3&gt;

&lt;p&gt;The transition from Ruby to JavaScript has been difficult. I've learned a lot and there's still so much to learn. I'll be honest, the Flatiron curriculum was tough and I didn't understand a lot, but once I started my project, I started understanding the material. For those of you struggling like me, building a JavaScript project will help you immensely.&lt;/p&gt;

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

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>RESTful Routes in Rails</title>
      <dc:creator>Angela Lam</dc:creator>
      <pubDate>Sun, 09 May 2021 06:39:47 +0000</pubDate>
      <link>https://dev.to/anglam/restful-routes-in-rails-107e</link>
      <guid>https://dev.to/anglam/restful-routes-in-rails-107e</guid>
      <description>&lt;p&gt;Routes are how requests, through URL and HTTP method, are directed to code that handles the routes. RESTful, Representation State Transfer, routes is a more structured way of defining how our routes work. RESTful routes provide mapping between HTTP verbs, controller actions, and CRUD operations in a database. CRUD represents an acronym for the database operations Create, Read, Update, and Delete (or Destroy). The controller actions, or CRUD, respond to the HTTP verbs, which are GET, POST, PUT and DELETE, as seen in the table below.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt; 
    &lt;th&gt;HTTP Verb&lt;/th&gt;  
    &lt;th&gt;Path&lt;/th&gt;
    &lt;th&gt;Controller#Action&lt;/th&gt;
    &lt;th&gt;Used for&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;GET&lt;/td&gt;
    &lt;td&gt;/posts&lt;/td&gt;
    &lt;td&gt;posts#index&lt;/td&gt;
    &lt;td&gt;display all posts&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;GET&lt;/td&gt;
    &lt;td&gt;/posts/new&lt;/td&gt;
    &lt;td&gt;posts#new&lt;/td&gt;
    &lt;td&gt;return an HTML form for creating a new post&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;POST&lt;/td&gt;
    &lt;td&gt;/posts&lt;/td&gt;
    &lt;td&gt;posts#create&lt;/td&gt;
    &lt;td&gt;create a new post&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;GET&lt;/td&gt;
    &lt;td&gt;/posts/:id&lt;/td&gt;
    &lt;td&gt;posts#show&lt;/td&gt;
    &lt;td&gt;display a specific post&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;GET&lt;/td&gt;
    &lt;td&gt;/posts/:id/edit&lt;/td&gt;
    &lt;td&gt;posts#edit&lt;/td&gt;
    &lt;td&gt;return an HTML form for editing a post&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;PATCH/PUT&lt;/td&gt;
    &lt;td&gt;/posts/:id&lt;/td&gt;
    &lt;td&gt;posts#update&lt;/td&gt;
    &lt;td&gt;update a specific post&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;DELETE&lt;/td&gt;
    &lt;td&gt;/posts/:id&lt;/td&gt;
    &lt;td&gt;posts#destroy&lt;/td&gt;
    &lt;td&gt;delete a specific post&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In my Rails project for Flatiron, in addition to RESTful routes, I used nested resources. Resources syntax is a useful way to have Rails generate each of the seven RESTful routes for you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# config/routes.rb
Rails.application.routes.draw do
  resources :posts
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;resources: posts&lt;/code&gt; in our routes.rb file will give you the seven RESTful routes for your application. Now let's say my application has a comments model. A comment belongs to a post and a post has many comments. If I wanted a route to look at a posts comments, such as &lt;code&gt;/posts/1/comments&lt;/code&gt;, I would need to utilize nested resources.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# config/routes.rb
Rails.application.routes.draw do
  resources :posts do
    resources :comments
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In our routes.rb file we nest comments resources under our posts resources to create some nested resources. Posts still gets the seven RESTful routes, while comments get seven NESTED RESTful routes.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt; 
    &lt;th&gt;HTTP Verb&lt;/th&gt;  
    &lt;th&gt;Path&lt;/th&gt;
    &lt;th&gt;Controller#Action&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;GET&lt;/td&gt;
    &lt;td&gt;/posts/:post_id/comments &lt;/td&gt;
    &lt;td&gt;comments#index&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;GET&lt;/td&gt;
    &lt;td&gt;/posts/:post_id/comments/new&lt;/td&gt;
    &lt;td&gt;comments#new&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;POST&lt;/td&gt;
    &lt;td&gt;/posts/:post_id/comments&lt;/td&gt;
    &lt;td&gt;comments#create&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;GET&lt;/td&gt;
    &lt;td&gt;/posts/:post_id/comments/:id&lt;/td&gt;
    &lt;td&gt;comments#show&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;GET&lt;/td&gt;
    &lt;td&gt;/posts/:post_id/comments/edit&lt;/td&gt;
    &lt;td&gt;comments#edit&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;PATCH/PUT&lt;/td&gt;
    &lt;td&gt;/posts/:post_id/comments/:id&lt;/td&gt;
    &lt;td&gt;comments#update&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;DELETE&lt;/td&gt;
    &lt;td&gt;/posts/:post_id/comments/:id&lt;/td&gt;
    &lt;td&gt;comments#destroy&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Nesting resources can get out of hand pretty quick, so best practice is to never nest more than 1 level deep (2 resources). The nested resources should have a parent/child relationship -- posts is the parent and comments is the child. Helpful tip: the last resource in the route is the controller that handles the requests. &lt;code&gt;/posts/:post_id/comments/new&lt;/code&gt; the new action for creating a new comment belonging to a specific post will be handled in the comments controller. One thing to note, the nested child resource are NESTED RESTful routes. If you want routes such as &lt;code&gt;/comments/:id&lt;/code&gt;, &lt;code&gt;/comments/new&lt;/code&gt;, or &lt;code&gt;/comments/edit&lt;/code&gt;, you must include comments resources in your config/routes.rb file to get non-nested RESTful routes for comments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# config/routes.rb
Rails.application.routes.draw do
  resources :posts do
    resources :comments
  end
  resources :comments
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my project, I had itineraries nested under my destinations, so I wanted to be able to destroy all itineraries related to a destination.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# config/routes.rb
Rails.application.routes.draw do
  resources :destinations do
    resources :itineraries do
      delete: destroy_all, on: :collection
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding &lt;code&gt;delete: destroy_all, on: :collection&lt;/code&gt;, creates a destroy_all action in the itineraries controller where I can delete all the itineraries under the current destination_id that belong to the user. This is a helpful action that allows me to delete a collection, and save the &lt;code&gt;itineraries#destroy&lt;/code&gt; route for deleting a single itinerary.&lt;/p&gt;

&lt;p&gt;If you want to see the routes on your application you can run your server followed by &lt;code&gt;/rails/info/routes&lt;/code&gt; or run &lt;code&gt;rails routes&lt;/code&gt; in your terminal to display your current routes. Here is a guide on &lt;a href="https://guides.rubyonrails.org/routing.html#nested-resource"&gt;nested resources&lt;/a&gt; for more information.&lt;/p&gt;

&lt;p&gt;The Request/Response Flow uses RESTful routing. The user makes a request to a route. The application goes into the config/routes.rb to match the route to a controller/action. The logic in the action will be processed and the controller may interact with the model. Rails then renders the view associated with the action with the given data.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>database</category>
    </item>
    <item>
      <title>Understanding Params In Sinatra</title>
      <dc:creator>Angela Lam</dc:creator>
      <pubDate>Mon, 08 Mar 2021 00:13:09 +0000</pubDate>
      <link>https://dev.to/anglam/understanding-params-in-sinatra-20oo</link>
      <guid>https://dev.to/anglam/understanding-params-in-sinatra-20oo</guid>
      <description>&lt;h2&gt;
  
  
  Params?
&lt;/h2&gt;

&lt;p&gt;For my second project at Flatiron, I had to create an MVC Sinatra application. My &lt;a href="https://github.com/ang-lam/sinatra_project"&gt;project&lt;/a&gt; was a simple weightlifting tracker where users can log their workouts with exercises and weights. The user creates new workout and exercises by filling out forms, the information from the forms are necessary for me to create my objects in my application. Throughout building my application, one thing I had to test and work with was params. After the user fills out the forms on the site, I had to grab the information from the params hash. I constantly had to go into pry to see what my params was returning to make sure my code was grabbing the correct information. &lt;/p&gt;

&lt;p&gt;What is params? Params is short for the word parameter. A parameter a hash that stores key-value pairs that is encoded in a HTTP request. Params comes from ActionController::Base, which is accessed by your application via ApplicationController. Specifically, params refers to the parameters being passed to the controller via a GET or POST request. Params is a method that returns an ActionController::Parameter object that behaves like a hash. It is a way to pass data that goes through our URL and routes. You can call params to access form and URL query data. One thing to note is that the values of a params hash are always a string, even if submitted as an integer. If a field is left blank you'll get an empty string. &lt;/p&gt;

&lt;p&gt;How do we pass parameters in Sinatra? I will be focusing on two methods; through a form and dynamic parameters in the URL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Form Parameters
&lt;/h2&gt;

&lt;p&gt;When data comes through a form, it is an HTML form which is filled by the user. This is known as POST data because it is sent as part of an HTTP POST request. The params hash is not limited to one-dimensional keys and values. It can contain nested arrays and hashes. To send an array of values, append an empty pair of square brackets "[]" to the key name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;form action="/student" method="post"&amp;gt;
  Student Name: &amp;lt;input type="text" name="student[name]"&amp;gt;
  Student Grade: &amp;lt;input type="text" name="student[grade]"&amp;gt;
  Course Name: &amp;lt;input type="text" name="student[course][name]"&amp;gt;
  Course Topic: &amp;lt;input type="text" name="student[course][topic]"&amp;gt;
  &amp;lt;input type="submit"&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The form above, takes in four inputs from the user. The name attribute in the form build the params hash. After filling out the form and submitting the information, the information will fill your params hash.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;params = {
  "student" =&amp;gt; {
    "name" =&amp;gt; "Joe",
    "grade" =&amp;gt; "9",
    "course" =&amp;gt; {
      "name" =&amp;gt; "US History",
      "topic" =&amp;gt; "History"
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below are methods to accessing the values in the params.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;params["student"]["name"] = "Joe"
params["student"]["course"]["name"] = "US History"
params["student"]["course"]["topic"] = "History"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you can access your information, you can save that information to a variable or instance variable to use in your route or erb file. The values from the params can be used to assign attributes to objects in your database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dynamic parameters
&lt;/h2&gt;

&lt;p&gt;Dynamic parameters are used in dynamic routes. A route is simply an HTTP method/verb that is paired within a URL-matching pattern. When you Sinatra application receives a request, it will match that route to a specific controller action that matches the URL pattern. Dynamic parameters are used in routes based on attributes within the URL of the request, these attributes is a variable whose values are set dynamically in a page's URL and can be accessed by its corresponding controller action.&lt;/p&gt;

&lt;p&gt;We use dynamic routes because it doesn't make sense to hard-code each route individually (&lt;code&gt;'/medicines/1'&lt;/code&gt;, &lt;code&gt;'/medicines/2'&lt;/code&gt;, &lt;code&gt;'/medicines/123'&lt;/code&gt;) in the controller to display each medicine. This is where dynamic routes come in. In the example below, we want to create a dynamic route that will allow us to get the correct page for the medicine of interest.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# medicines_controller.rb
get '/medicines/:id' do
  @medicine = all_the_medicines.select do |medicine|
    medicine.id == params[:id]
  end.first
  erb :'/medicines/show.html'
end 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The HTTP request verb, &lt;code&gt;GET&lt;/code&gt; matches the &lt;code&gt;get&lt;/code&gt; method in our controller. The &lt;code&gt;/medicines&lt;/code&gt; path in the HTTP request matches the &lt;code&gt;/medicines&lt;/code&gt; path in our controller method. The id parameter that's being passed into the path, matches the controller's expectation for an id parameter to be passed in place of &lt;code&gt;:id&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I lost track of the amount of times I went into pry to see the what my params was returning. Params is an important hash to understand when working with Sinatra or Rails. It's a method for users to submit information that is used by the application. Params can also be used for dynamic routes, which allow you to access more routes without having to hard-code each route. When building your Sinatra project, always check your params and understand the format of your params. It'll make your life way easier and save you the headache of grabbing the wrong information from your params.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Building my first CLI </title>
      <dc:creator>Angela Lam</dc:creator>
      <pubDate>Sat, 09 Jan 2021 08:19:24 +0000</pubDate>
      <link>https://dev.to/anglam/building-my-first-cli-1lbk</link>
      <guid>https://dev.to/anglam/building-my-first-cli-1lbk</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;About two months ago I started Flatiron's software engineering program. I basically had zero coding skills and knowledge coming into this program. Now that I've been learning Ruby for the past two months, I have built my first CLI. My CLI pulls from a &lt;a href="https://makeup-api.herokuapp.com/" rel="noopener noreferrer"&gt;makeup API&lt;/a&gt; to let the user browse specific tags that cater to the users specific needs. After selecting a tag, a list of product types for that tag is given to the user. Selecting a product type will give a detailed list of products with the brand, description, and website link. &lt;/p&gt;

&lt;p&gt;This is my first project so there were some learning curves with github, environments, and coding in general. I came across a lot of useful things while building my CLI that I would like to share.&lt;/p&gt;

&lt;h2&gt;
  
  
  system("clear")
&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%2Fi%2Fkeh9ltvsmuettxwmrliu.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%2Fi%2Fkeh9ltvsmuettxwmrliu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&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%2Fi%2Fart3blrjcasph04pwjpt.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%2Fi%2Fart3blrjcasph04pwjpt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The best thing for a terminal app is implementing &lt;code&gt;system("clear")&lt;/code&gt; in your code. I placed this code right after getting the user input, so the terminal window is cleared before the information that the user selected is displayed. This keeps your terminal looking clean and readable for the user after they put inputs into the terminal. Something so little made a huge difference to my CLI.&lt;/p&gt;
&lt;h2&gt;
  
  
  Iterators &lt;code&gt;each&lt;/code&gt;, &lt;code&gt;map/collect&lt;/code&gt;, &lt;code&gt;select&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Learning the common iterators and what they return and do is so useful for iterating over collections. I used &lt;code&gt;.collect&lt;/code&gt; and &lt;code&gt;.select&lt;/code&gt; to collect information from my API throughout building my CLI.&lt;/p&gt;
&lt;h5&gt;
  
  
  each
&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;.each&lt;/code&gt; is generally used when you want to do something with each element of an array inside the block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array = [1, 2, 3, 4, 5]
array.each {|x| puts x}
output =&amp;gt; 
1
2
3
4
5
return =&amp;gt;
[1, 2, 3, 4, 5]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One thing to note is that &lt;code&gt;.each&lt;/code&gt; returns the original array object it was invoked upon. If you want to return an array with the results of the method you will have to create a new variable with an empty array and then push the results to that array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array = [1, 2, 3, 4, 5]
new_arr = []
array.each {|x| new_arr &amp;lt;&amp;lt; x*2}
new_arr
output =&amp;gt; 

return =&amp;gt;
[2, 4, 6, 8, 10]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An &lt;code&gt;.each&lt;/code&gt; iterator I used a lot in my project is &lt;code&gt;.each_with_index&lt;/code&gt;. This allowed me to iterate over my arrays of information to produce the list menus and the list of products in my CLI. The example below shows &lt;code&gt;.each_with_index&lt;/code&gt; being used with an array to print a number list for each element of the array. The &lt;code&gt;x&lt;/code&gt; represents each element of the array and &lt;code&gt;i&lt;/code&gt; represents the index corresponding to each element. To print a numbered list, we have to add 1 to the index to account for the index starting at 0.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array = ["a", "b", "c", "d", "e"]
array.each_with_index {|x, i| puts "#{i + 1}. #{x}"}
output =&amp;gt;
1. a
2. b
3. c
4. d
5. e
return =&amp;gt;
["a", "b", "c", "d", "e"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  map/collect
&lt;/h5&gt;

&lt;p&gt;The &lt;code&gt;.collect&lt;/code&gt; or &lt;code&gt;.map&lt;/code&gt; method allows us to iterate through an array like &lt;code&gt;.each&lt;/code&gt;, but &lt;code&gt;.collect&lt;/code&gt; returns a new array with the results of our iterator. &lt;code&gt;.collect&lt;/code&gt; and &lt;code&gt;.map&lt;/code&gt; are the same and can be used interchangeably. This iterator was useful in my CLI to iterate over my array of collections to get new arrays with deeper information within the hash of my API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array = [1, 2, 3, 4, 5]
new_arr = array.collect {|x| x*2}
new_arr
output =&amp;gt; 

return =&amp;gt;
[2, 4, 6, 8, 10]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  select
&lt;/h5&gt;

&lt;p&gt;The .select method iterates over an array and grabs all elements for which the specified statement in the block is true. This returns a new array with all the elements that satisfy the block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array = [1, 2, 3, 4, 5]
new_arr = array.select {|x| x.even?}
new_arr
output =&amp;gt; 

return =&amp;gt;
[2, 4]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  find
&lt;/h5&gt;

&lt;p&gt;The &lt;code&gt;.find&lt;/code&gt; method is similar to the &lt;code&gt;.select&lt;/code&gt; method, but returns the first element that satisfies the block and stops iterating. It does not return an array and does not return all elements that satisfy the block. In the example below, the return is 2, not in an array, and 4 is not returned.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array = [1, 2, 3, 4, 5]
new_arr = array.select {|x| x.even?}
new_arr
output =&amp;gt; 

return =&amp;gt;
2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  word_wrap gem
&lt;/h2&gt;

&lt;p&gt;For my API, I pull a description for each item, which is a long string. An issue I ran into was the descriptions breaking in the middle of words when the string hit the edge of the terminal. The &lt;a href="https://makeup-api.herokuapp.com/" rel="noopener noreferrer"&gt;word_wrap gem&lt;/a&gt; is the gem that fixed this issue. The function of the gem is the name of the gem, it wraps your text to a set width in your terminal.&lt;/p&gt;

&lt;h2&gt;
  
  
  In the end...
&lt;/h2&gt;

&lt;p&gt;After finishing my CLI, I realized there were different methods I could've gone about with my CLI. Having people look over my code, I realized I brute forced some parts of my CLI, but I'm still a beginner. I will probably go through it in the future to improve the code, but for now my finished CLI is a finished product and functions perfectly, and I feel accomplished with my first CLI.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>showdev</category>
      <category>beginners</category>
      <category>coding</category>
    </item>
    <item>
      <title>Taking the Bio out of Biotech</title>
      <dc:creator>Angela Lam</dc:creator>
      <pubDate>Wed, 18 Nov 2020 09:19:51 +0000</pubDate>
      <link>https://dev.to/anglam/taking-the-bio-out-of-biotech-4oba</link>
      <guid>https://dev.to/anglam/taking-the-bio-out-of-biotech-4oba</guid>
      <description>&lt;p&gt;&lt;strong&gt;My background:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Growing up I was always set on a career in the medical field. My goal was to be in a profession that would allow me to help and have an impact on people. I'll be honest that medical school was not appealing to me due to the amount of years you have to put into schooling. Thus, I chose the pharmacy route, which led me to graduating with a biochemistry degree. While trying to pursue pharmacy school, I was working at a Virology clinical research lab as a researcher. Slowly, I began to notice that I enjoyed lab work more than pharmacy. I dropped my goals of being a pharmacist and have been working in the biotech field for four years. I've done my fair share of academia research, but now I'm in the biotech field. Working for a giant biopharmaceutical company doing cancer research couldn't be more fulfilling, but I'm ambitious and want to learn and build new skills outside my comfort zone. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now I think it's time for me to take the bio out of biotech and go the tech route.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My time in the biotech field has exposed me to what coding can do. I've seen how other scientist can take some data, analyze it with code, and put it through software they designed. I've seen engineers build a request scheduling program for my team that helped with the productivity and organization of my team at work. I'm a curious human by nature, so the curiosity got the best of me. I want to be able to do that. I'm going to learn software engineering to gain these skills.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creativity is limited by me.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I can start from scratch with software engineering and build it up to a complete product designed by me. Software engineering gives me a sense of ownership of my creations and also allows me to be creative. I can build applications that are useful to me and others. I always strive to feel fulfilled in my job, so I need to be in a career field that allows me to feel this way. I want to know that the work I'm doing has a positive effect on others. The technology we use has been developed by engineers and many websites, software, and programs have been beneficial to our everyday lives. I want to be a software engineer and build applications that can have a positive impact and benefit people. The programming field also has an abundance of jobs with different skill sets. There are programmers in all fields, like the biotech field and the business field. Being a coder doesn’t hold you in one field or one “profession.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Time to hangup my lab coat and start coding!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>career</category>
      <category>welcome</category>
    </item>
  </channel>
</rss>
