<?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: Samuel Littell</title>
    <description>The latest articles on DEV Community by Samuel Littell (@samlittellmds).</description>
    <link>https://dev.to/samlittellmds</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%2F906733%2Fab1a8a50-41ec-4155-b4c7-9d85248e6bd0.jpeg</url>
      <title>DEV Community: Samuel Littell</title>
      <link>https://dev.to/samlittellmds</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/samlittellmds"/>
    <language>en</language>
    <item>
      <title>TS Part 2: Getting Started with TypeScript</title>
      <dc:creator>Samuel Littell</dc:creator>
      <pubDate>Mon, 12 Dec 2022 00:11:13 +0000</pubDate>
      <link>https://dev.to/samlittellmds/ts-part-2-getting-started-with-typescript-16fm</link>
      <guid>https://dev.to/samlittellmds/ts-part-2-getting-started-with-typescript-16fm</guid>
      <description>&lt;p&gt;So in my previous post we learned a little bit about the background, history, and purposes of TypeScript and how it could potentially be used, or not used, for your application's development. Now I want take a look at some of the basic TypeScript fundamentals and how to get started using TypeScript in your React or JavaScript projects.&lt;/p&gt;

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

&lt;p&gt;First, a simple way to initialize a new React project with TypeScript is to utilize &lt;code&gt;npx create-react-app my-app&lt;/code&gt; but with &lt;code&gt;--template typescript&lt;/code&gt; following it. So simply pop open your terminal, set it to the desired directory, and input the command: &lt;code&gt;npx create-react-app my-app --template typescript&lt;/code&gt;. So now, you will have initialized a new React app set-up with all of the TypeScript dependencies needed for your project. Immediately upon opening your &lt;em&gt;"my-app"&lt;/em&gt; directory in your source-code editor, the first thing you'll notice is that all your files are now followed by the &lt;code&gt;.tsx&lt;/code&gt; extension, as opposed to &lt;code&gt;.jsx&lt;/code&gt;. But, if you already have a React project in progress, you can add TypeScript by installing it with the command: &lt;code&gt;npm install --save typescript @types/node @types/react @types/react-dom @types/jest&lt;/code&gt;. &lt;/p&gt;

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

&lt;p&gt;If you're not using React and want to implement TypeScript in your JavaScript/HTML project, you'll need to first run the command &lt;code&gt;npm init -y&lt;/code&gt; which will load your package.json file with your dependencies and scripts inside. Now, simply install TypeScript with the command &lt;code&gt;npm i --save-dev typescript&lt;/code&gt;. You should now see TypeScript loaded into your dev-dependency list, which we put there since TypeScript is not required for production. On top of this you will need to load your &lt;code&gt;tsconfig.json&lt;/code&gt; file which will contain a boiler-plate list of default TypeScript properties which are either commented out or uncommented. Simply uncomment out any other properties to activate them. To load the config file use the command: &lt;code&gt;npx tsc --init&lt;/code&gt;. Lastly, there are multiple options to compile your TypeScript code into JavaScript, and to bundle your files, but in order keep this short, I would highly recommend researching those options on your own, and see what is best suited for the application you're developing. &lt;em&gt;(Snowpack apparently has a very quick/easy set-up for TypeScript Applications.)&lt;/em&gt; &lt;/p&gt;

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

&lt;p&gt;In my previous TypeScript post we quickly took a look at some of the very basic typing, such as string, number, and boolean. But what if we need to type something a bit more complex, such as an array? Or what happens if an array needs to contain multiple types?&lt;/p&gt;

&lt;p&gt;To type an array we need to first declare our variable and assign it a type. This can be any type, but in order to apply it to an array, it needs to be followed by square brackets, giving you something like this:&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="c1"&gt;// Declaration&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;arrayStr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;arrayNum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;arrayBool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;

&lt;span class="c1"&gt;// Initialization&lt;/span&gt;
&lt;span class="nx"&gt;arrayStr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Apple&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Orange&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Banana&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nx"&gt;arrayNum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nx"&gt;arrayBool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// TypeError: 'string' is not assignable to type 'number'.&lt;/span&gt;
&lt;span class="nx"&gt;arrayNum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;4&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or using generic array type syntax in your declaration is another option:&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="c1"&gt;// Declaration&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;arrayStr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;arrayNum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;arrayBool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Initialization&lt;/span&gt;
&lt;span class="nx"&gt;arrayStr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Apple&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Orange&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Banana&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nx"&gt;arrayNum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nx"&gt;arrayBool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// TypeError: 'string' is not assignable to type 'number'.&lt;/span&gt;
&lt;span class="nx"&gt;arrayNum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;4&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Now, if we want our array to contain different types, we can utilize what TypeScript calls a Tuple. A tuple can contain multiple types of data. To achieve this we simply declare our types wrapped in square brackets, then initialize with the corresponding values, like so:&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="c1"&gt;// Declaration&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;tuple&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// Initialization&lt;/span&gt;
&lt;span class="nx"&gt;tuple&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;opSpark&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// TypeError: Type 'number' is not assignable to type 'string'.&lt;/span&gt;
&lt;span class="nx"&gt;tuple&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or if we need to wrap our tuple into an array, try this:&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="c1"&gt;// Declaration&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;tupleArr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;][];&lt;/span&gt;

&lt;span class="c1"&gt;// Initialization&lt;/span&gt;
&lt;span class="nx"&gt;tupleArr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Sam&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Student&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="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;opSpark&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;

&lt;span class="c1"&gt;// TypeError: Type 'boolean' is not assignable to type 'string'.&lt;/span&gt;
&lt;span class="nx"&gt;tupleArr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Sam&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Student&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="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Finally, let's take a look at objects. Objects are fundamental to the way we move and group data in JavaScript. So, how can we define an object using TypeScript? There are actually two ways to declare an object, and the first really isn't recommended. Let's take a look at this:&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="c1"&gt;// Declaration&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;anObject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So this is a completely valid way to define an object in TypeScript, but an object can have a lot of different properties inside of it. So how can we validate that the object we are trying to utilize contains the corresponding set of types? Well, TypeScript provides us with a &lt;code&gt;type&lt;/code&gt; keyword. To use these just start with the &lt;code&gt;type&lt;/code&gt; keyword followed by the name or &lt;em&gt;"alias"&lt;/em&gt; of your object. By utilizing objects in TypeScript not only can we assure that the correct type is being used, but also catch missing properties, check it out:&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="c1"&gt;// Create type alias&lt;/span&gt;
&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Initialize / Declare an object with new type created&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;anObject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Sam&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;35&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// TypeError: Property 'age' is missing in type &lt;/span&gt;
&lt;span class="c1"&gt;// '{ name: string; }' but required in type 'Object'. &lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;anObject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Sam&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="c1"&gt;// TypeError: Type 'string' is not assignable to type 'Number'. &lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;anObject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Sam&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;35&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So there you have it! I hope this was helpful and shows how catching type errors at the time of compile, and not later at runtime, can be super helpful and an efficient way of correcting your code. Hopefully TypeScript can become an important part of your workflow. Happy coding!&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>react</category>
    </item>
    <item>
      <title>TS Part 1: What is TypeScript?</title>
      <dc:creator>Samuel Littell</dc:creator>
      <pubDate>Mon, 05 Dec 2022 04:17:40 +0000</pubDate>
      <link>https://dev.to/samlittellmds/what-is-typescript-2ekg</link>
      <guid>https://dev.to/samlittellmds/what-is-typescript-2ekg</guid>
      <description>&lt;p&gt;Typescript, put simply, is a superset of JavaScript that is object oriented and is considered "strongly typed". A strongly typed programming language is one in which restrictions are firmly enforced when mixing different data types and values. These restrictions can ensure a consistency of results, but at the sacrifice of flexibility. Whether or not that sacrifice is worth it is up to the developer or depends on the type of application being developed.&lt;/p&gt;

&lt;p&gt;TypeScript was created in 2010 when JavaScript was still perceived as a programming language that wasn't really capable of handling large scale applications. Microsoft acknowledged this perception and chose to do something about it, thus creating what we now know as TypeScript. In 2012, Anders Hejlsberg, a core Microsoft developer of TypeScript, said &lt;em&gt;"JavaScript was never really designed to be a programming language for big applications"&lt;/em&gt; and that JavaScript &lt;em&gt;"lacked some of the structuring mechanisms that you need in large applications like classes and modules and perhaps interfaces."&lt;/em&gt; So Microsoft built TypeScript on top of JavaScript which allowed them to create the ideal development platform they desired, while still benefitting from the broader JavaScript ecosystem. Today most of Microsoft's former objections about JavaScript have actually been solved, but even with those improvements, TypeScript is still very valuable.&lt;/p&gt;

&lt;center&gt;_**Anders Hejlsberg (co-creator of TypeScript)**_&lt;/center&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%2Fx3kkrso17tmu6osnktcs.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%2Fx3kkrso17tmu6osnktcs.png" alt="Anders Hejlsberg" width="382" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In dynamically typed languages like JavaScript, you don't necessarily think about the types of data in your code, at least not as much as you would in a statically typed languages. Variables, for instance, are containers for values, but when you use variables in your code, you may not necessarily be considering their types. In a larger apps you can have hundreds or thousands of variables in your code, and if you're not careful, you can introduce bugs by mistakenly referencing a variable with the wrong type. TypeScript allows the developer to define what type a variable will be when that variable is declared.&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="c1"&gt;// JavaScript&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;city&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;New Orleans&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;zip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;70130&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;visited&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// TypeScript&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;New Orleans&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;70130&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;visited&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So in the example above we see the city, zip, and visited variables declared in JavaScript, and then updated with Typescript. Now city must always contain a value with a type of string, zip with a type of number, and visited with a type of boolean.&lt;/p&gt;

&lt;p&gt;TypeScript can also be thought of as a type of linter. It can validate your code similarly to Prettier or ESLint, and makes troubleshooting problematic code a bit easier. TypeScript can autocomplete your code as it's written, warn if a function is used incorrectly, alerts you if an object is missing a required property, or even something simple, like letting you know if a return value is missing at the end of a function.&lt;/p&gt;

&lt;p&gt;Finally, TypeScript can also be thought of as a compiler, which means it can take JavaScript and TypeSript code and transform them to support different features for older JavaScript engines. So TypeScript is actually a bit more than simply just adding types to JavaScript! &lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;u&gt;Resources:&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.cleverism.com/skills-and-tools/typescript/#:~:text=TypeScript%20is%20a%20relatively%20new,working%20on%20the%20project%20too." rel="noopener noreferrer"&gt;History of TypeScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.typescriptlang.org/docs/" rel="noopener noreferrer"&gt;TS Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>discuss</category>
    </item>
    <item>
      <title>UXUI Part 2: Getting Started with Figma</title>
      <dc:creator>Samuel Littell</dc:creator>
      <pubDate>Mon, 28 Nov 2022 14:54:28 +0000</pubDate>
      <link>https://dev.to/samlittellmds/ux-ui-tools-getting-started-with-figma-15nf</link>
      <guid>https://dev.to/samlittellmds/ux-ui-tools-getting-started-with-figma-15nf</guid>
      <description>&lt;p&gt;The UX/UI tool I'll be taking a look at is Figma, which is marketed as a "collaborative interface design tool". Considering there are multiple other design and prototyping applications out there, I chose Figma primarily based on a quick search, which yielded thousands of positive user responses from the design community. I did find other design tools appealing, such as Adobe XD and Sketch, but Figma seemed to have a more devoted fan base supported by a plethora of easily available content such as documentation and tutorials. Coming from a developer point of view, I feel as though examining Figma and the UX/UI design process will better prepare me to have a more streamlined and flexible relationship with a design team, before injecting their design with code from the front-end.&lt;/p&gt;

&lt;p&gt;At a quick glance it's immediately obvious that Figma's main emphasis is collaboration. It's primary user interface is browser based and allows for a live and simultaneous multi-user work environment. Users can also choose a desktop application for windows and mac, although the desktop applications also require internet access. The built-in online/cloud nature of Figma allows for large teams to always be in sync with a project, and files never need to be sent manually or stored else-where for access. Users can also drop comments directly into a design project for instant feedback and communication. A free account is simple enough to set-up, just go to the Figma website and login either manually or using your google account. A free account is allowed up to 3 working files before you're forced to purchase a premium subscription plan. These are set-up for either individuals using the application or entire organizations, and can range from $12 to $45 per month for the design plans. But, if all you need from Figma is its whiteboarding/presentation/planning capabilities, there are cheaper plans available (aka FigJam) ranging from $3 to $5 per month as seen below:&lt;/p&gt;

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

&lt;p&gt;Figma has an important role in the UX/UI process. It can create rapid and high-res prototypes of applications and websites, and can also include some interactivity. While the prototype you create is merely a loose mock-up of the finished product, it's still capable of going to peers, developers, or clients for testing. This means before the user puts a ton of work into a full scale application, they can get important and instantaneous feedback from their presentation prototype. So before moving forward, and stepping outside the scope of the design stages in the creation process, important information can be collected. At this point, if changes to the design need to be made, they can be made really quickly in Figma, until a desirable response is received, and then coding / development will pick up the project from here. The passing off stage between the designer and developer can be a complicated one. But luckily applications, like Figma and others, can assist and ease some of the struggles of this process, and create a more desirable work flow.&lt;/p&gt;

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

&lt;p&gt;When first starting a new design draft in Figma, it can be a bit intimidating. You are immediately greeted with a rather blank and minimal user interface with a simple iconographic tool bar &lt;em&gt;(as seen above)&lt;/em&gt;, but once you get past this part, the software really begins to open up. It appears the first step in designing your prototype is selecting a frame size. This can be done by simply drag and dropping out your custom frame size, or selecting from the frame size presets that Figma provides. These include mobile phone screen sizes, tablets, or desktop sizes, among many others. Once your frame size is selected you can begin to work with primitive shapes, and lay out the foundations of your design. In the small time I played around with the shapes in my workspace, I noticed subtle snapping, locking, and spacing assistance that Figma provides to speed up the design process. Here is a quick submission form mock-up I created:&lt;/p&gt;

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

&lt;p&gt;Adding text components to your design is also done with ease. Simply selecting the text editor and creating your text box area allows you to play and experiment with many different text styles and font combinations. Similarly to the shapes discussed above, Figma provides "smart" guides for snapping and aligning your text quickly and easily. Another plus, is that Figma comes preloaded with Google Fonts, as well as allowing you to import any locally stored fonts from your personal computer. I was pleasantly surprised seeing Roboto set as my default font upon start up. Here are a few text styles I played with:&lt;/p&gt;

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

&lt;p&gt;I'm just barely scratching the surface here, there are tons of features that Figma can provide including: creating animations for rollover or onclick events, transition animations between frames or slides &lt;em&gt;(as seen below)&lt;/em&gt;, and even plug-ins which can help generate rough code based on your design. In conclusion I think Figma is a pretty fantastic design tool. It's ease of use, combined with a highly collaborative work environment makes for a powerful and communicative application that can assist in translating design into an interactive finished product. I hope this soft introduction was helpful and hopefully sheds some light on the UX/UI process. Happy designing. &lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;&lt;u&gt;Resources:&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://help.figma.com/hc/en-us/articles/360039818874-Create-advanced-animations-with-smart-animate"&gt;Animated GIF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://help.figma.com/hc/en-us/categories/360002051613-Get-started"&gt;Getting Started&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>figma</category>
      <category>ux</category>
      <category>ui</category>
      <category>design</category>
    </item>
    <item>
      <title>UXUI Part 1: A Look into UI &amp; UX Design</title>
      <dc:creator>Samuel Littell</dc:creator>
      <pubDate>Sun, 16 Oct 2022 21:05:52 +0000</pubDate>
      <link>https://dev.to/samlittellmds/a-look-into-ux-ui-design-135j</link>
      <guid>https://dev.to/samlittellmds/a-look-into-ux-ui-design-135j</guid>
      <description>&lt;p&gt;&lt;em&gt;(Cover Image Source: &lt;a href="https://www.techprevue.com/wp-content/uploads/2016/07/mobile-app-ux-ui-basics.jpg"&gt;Link&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;From afar, UI and UX design careers appear to be one of those things that anyone can break into. If you understand people, how they interact with things, and what they like, you essentially understand UI and UX. People from several different types of backgrounds and degrees end up in this growing field. It's where psychology meets design, and where design is king. But what is the difference between the two, and how has UI/UX become such a prominent subject in tech today?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“UI is the saddle, the stirrups, &amp;amp; the reins. UX is the feeling you get being able to ride the horse.”&lt;br&gt;
— Dain Miller, Web Developer&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On the most basic level UX can be summed up as how things work, while UI is how things look. This may be a grand oversimplification, but in order to differentiate between these two overlapping subjects, it's simply easier to draw a line in the sand. Another way you could think about it, is that UI is a sub-category of UX, and UX is kind of an overarching topic that encompasses UI. UX can mean several different things, while UI is a bit more specific.&lt;/p&gt;


&lt;center&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tEXqGth2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aoelln4h1p7yml5cw0g9.jpg" alt="Image description" width="720" height="400"&gt;&lt;/center&gt;

&lt;p&gt;UI, or user interface, is a graphical thing; colors, branding, and making users remember you or your brand are essential ideas to effective UI. Given these things, you can easily imagine someone with an arts or design degree would be strongly suited for UI. Someone who can make effective decisions about a simple button click animation or imagery on an app/website, can drastically improve traffic to your business, and create a deep feeling of connection with your target audience. But strong UI can also be beneficial outside the scope of capitalistic endeavors. Web features like larger fonts, accessible colors, high contrast environments, and interchangeable visual modes can add value for individuals with impairments. This can all be achieved by using and implementing well thought out UI design.      &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“People ignore design that ignores people.”&lt;br&gt;
— Frank Chimero, Designer&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;UX, or user experience, is about experience. &lt;em&gt;(Duh)&lt;/em&gt; It's about how something looks and works in order to create an easy and enjoyable experience for the user. Getting feedback from users is also very important. Testing things, getting feedback, and then deeply analyzing that feedback is important to the UX process. You must ask yourself, on a psychological level, what appeals to a user, and compare what they like vs. what they don't like. Is the user having a good experience regardless of how the product works? Does the user learn to use your product easily? These are just two of the many questions you can ask yourself in the planning and analysis stages of successful UX design.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“If I had an hour to solve a problem and my life depended on the solution, I would spend the first 55 minutes determining the proper question to ask, for once I know the proper question, I could solve the problem in less than five minutes.”&lt;br&gt;
— Albert Einstein, Theoretical Physicist&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To better understand the concept of UX design lets take a quick look at the 5 key stages of the UX process according to &lt;a href="https://careerfoundry.com/"&gt;CareerFoundry&lt;/a&gt;:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6M2w08aP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vjr44k4w9zldxhduo1qi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6M2w08aP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vjr44k4w9zldxhduo1qi.png" alt="Image description" width="218" height="191"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;First stage:&lt;/strong&gt; In the &lt;strong&gt;&lt;em&gt;understand&lt;/em&gt;&lt;/strong&gt; stage, we take a close look at what users or customers want/need from your build, and then create a concept that actually solves or addresses those wants/needs. At this point it's important to pay attention to the small details. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xi3KwXUx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/28gyrgsl0fsfm161ytjt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xi3KwXUx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/28gyrgsl0fsfm161ytjt.png" alt="Image description" width="228" height="192"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Second stage:&lt;/strong&gt; In the &lt;strong&gt;&lt;em&gt;analyze&lt;/em&gt;&lt;/strong&gt; stage we examine how users already perceive a product, and then understand how weaknesses in the product should be addressed or where to maintain the product's strengths. This could be done by intense testing, or just simply asking the right questions in regards to your finished product. This stage is where a cohesive direction for your design is born.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--edY2ad8c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zps1lqrsap6hukuz1uau.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--edY2ad8c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zps1lqrsap6hukuz1uau.png" alt="Image description" width="217" height="195"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Third Stage:&lt;/strong&gt; Simply put, in the &lt;strong&gt;&lt;em&gt;ideate&lt;/em&gt;&lt;/strong&gt; stage we come up with ideas. This is where the problems we worked so hard to comprehend in the previous stage are addressed, and we come up with concrete ideas to fix those problems. This stage can be accomplished in several ways including digitally, in person meetings, or brainstorming on your own.&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lTjcvCHs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mwas65m8vp8y8uzmd69c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lTjcvCHs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mwas65m8vp8y8uzmd69c.png" alt="Image description" width="215" height="198"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Fourth Stage:&lt;/strong&gt; In the &lt;em&gt;&lt;strong&gt;validate&lt;/strong&gt;&lt;/em&gt; stage we take our idea or ideas from the previous stage and put them to the test. Assuming multiple ideas were generated in the third stage, this is the time where bad ideas are filtered out, and the great ideas rise to the top. This stage can be accomplished by sketching mock-ups or creating prototypes to mimic your final product whenever it may come to fruition.&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N78VUb1B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xk432koro8slcooxihiv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N78VUb1B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xk432koro8slcooxihiv.png" alt="Image description" width="219" height="190"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Fifth Stage:&lt;/strong&gt; The &lt;em&gt;&lt;strong&gt;iterate&lt;/strong&gt;&lt;/em&gt; stage occurs throughout all five stages. It is the process of revisiting and re-researching your previous problems, ideas, and concepts. This stage is something that can always be built on and improved. It essentially never ends because products and user are always changing/evolving.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
So there you have it, a quick look and introduction into the world of UX and UI design. As someone leaning more towards the front-end development side of web/software engineering, this was incredibly helpful in understanding the important processes that occur when creating a finished product. I hope it was also helpful for you!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(Vin Diagram Source: &lt;a href="https://creative.artisantalent.com/ux-ui-or-graphic-design-whats-the-difference"&gt;Link&lt;/a&gt;)&lt;/em&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

</description>
      <category>design</category>
      <category>ux</category>
      <category>ui</category>
    </item>
    <item>
      <title>Elixir Basics</title>
      <dc:creator>Samuel Littell</dc:creator>
      <pubDate>Mon, 10 Oct 2022 00:54:49 +0000</pubDate>
      <link>https://dev.to/samlittellmds/elixir-basics-41c4</link>
      <guid>https://dev.to/samlittellmds/elixir-basics-41c4</guid>
      <description>&lt;p&gt;Before I begin this blog, I think it would be wise to preface it with a brief statement. As someone who is in the early stages of their JavaScript learning journey, it may seem a bit premature to venture out into unknown territory. That territory specifically being another programming language, of which I probably have no business exploring. But I do believe this will be beneficial. Seeing another language's inner workings and understanding its syntax and data types &lt;em&gt;(even on a basic level)&lt;/em&gt; will maybe shed some light on how and where to address my weaknesses with JavaScript, and with coding in general.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;center&gt;
&lt;/center&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6sHuvYou--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yl8ait9462rher5why5z.png" alt="Image description" width="211" height="209"&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
Elixir is a functional programming language released by José Valim in the year 2012. It has gained a pretty substantial fan base since then, and is utilized in companies by the likes of Motorola, Pinterest, and Discord &lt;em&gt;(among many, many others)&lt;/em&gt;. It runs on top of the Erlang Beam virtual machine, which was actually developed in the 80s to scale the growing demands of phone switching. Elixir was essentially created to make the Erlang technology accessible to the every day developer. Elixir has a minimal and dynamically typed syntax inspired by Ruby, which makes it more approachable than other languages. Also, it's Phoenix web framework is responsible for the creation of thousands of full stack web applications.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;center&gt;
&lt;/center&gt;
&lt;/h2&gt;
&lt;h2&gt;
  
  
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L8QHZUoa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldpzg240lxuh942b04sb.png" alt="Image description" width="211" height="209"&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
Installing Elixir on your machine is a breeze. Simply visit the Elixir installation &lt;a href="https://elixir-lang.org/install.html"&gt;page&lt;/a&gt; and find your operating system in the installation list. For MacOS you simply run a command in your terminal, or for Windows follow a quick series of installation prompts, and voilà, you have Elixir installed. No need for path configuration or anything like that, just a straight install. To double check that the installation process was a success, head back over to your terminal and do a version check with the command: &lt;code&gt;elixir -v&lt;/code&gt;. (&lt;em&gt;At the time of writing this blog, Elixir is currently on version 1.14.0.&lt;/em&gt;) To get started with a new project, set your terminal to the desired directory, and use the command &lt;code&gt;mix new "project name"&lt;/code&gt;, and the necessary files will be loaded into your project folder, including a README, gitignore, library, and other basics.  &lt;/p&gt;

&lt;p&gt;Now that we have a project set up, let's start taking a look at the datatypes that make up Elixir.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;center&gt;
&lt;/center&gt;
&lt;/h2&gt;
&lt;h2&gt;
  
  
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FRXkonCi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/defaxp9m74da7wtwvs2n.png" alt="Image description" width="211" height="209"&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
The first two datatypes we will be taking a look at are integers and floats. These are both number data types, but they can never be strictly equal to each other. Any whole number is considered an integer, while floats are numbers with any given number of decimal places following that number. Here is a quick demonstration of how these two datatypes can be used together in operations, but in the end, are still different.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex(1)&amp;gt; 1 + 1
2       
iex(2)&amp;gt; 1.5 + 1.5
3.0     
iex(3)&amp;gt; 1 + 1.5
2.5     
iex(4)&amp;gt; 4 * 4
16      
iex(5)&amp;gt; 3 === 3.0
false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;center&gt;
&lt;/center&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mqJFr7vD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6to8zhk40cdgf9wug8rp.png" alt="Image description" width="211" height="209"&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
The next datatype is boolean. This is going to be your standard boolean datatype giving you true and false values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex(6)&amp;gt; true
true    
iex(7)&amp;gt; true === false
false 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can even wrap our value in an &lt;code&gt;is_boolean&lt;/code&gt; function to assess whether or not the value is in fact a boolean datatype.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex(8)&amp;gt; is_boolean(true)
true
iex(9)&amp;gt; is_boolean("a")
false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;center&gt;
&lt;/center&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gkKwCvVI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pa1umvhoxmf5yasktm6y.png" alt="Image description" width="211" height="209"&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
Strings in Elixir must be delimited by using double quotes. &lt;em&gt;(See yuh later single quotes.)&lt;/em&gt; Other than that, strings in Elixir behave pretty similarly to those in JavaScript. They can be concatenated together with the &lt;code&gt;+&lt;/code&gt; or &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; operators and Elixir also supports string interpolation by inserting your string value into an interpolation syntax: &lt;code&gt;#{string value}&lt;/code&gt;. To print a string value simply wrap your value in the &lt;code&gt;IO.puts(string value)&lt;/code&gt; function. Other string functions include &lt;code&gt;String.length(string value)&lt;/code&gt; and &lt;code&gt;String.upcase(string value)&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex(10)&amp;gt; string = "dog"
"dog"
iex(11)&amp;gt; "The #{string} ran fast"
"The dog ran fast"
iex(12)&amp;gt; "The " &amp;lt;&amp;gt; "#{string} " &amp;lt;&amp;gt; "ran fast" 
"The dog ran fast"
iex(13)&amp;gt; IO.puts("Hello World!")
Hello World!
iex(14)&amp;gt; String.length("hello")
5
iex(15)&amp;gt; String.upcase("hello")
"HELLO"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;center&gt;
&lt;/center&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9J3lT7af--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2c79s7yyrskj4lajsv37.png" alt="Image description" width="211" height="209"&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
Lists in Elixir are similar to arrays in other languages, but they're not exactly the same. Aesthetically, they're identical, but lists in Elixir behave more similarly to linked list data structures. The first element of the list is considered the "head" and the remaining elements are considered the "tail". The first and remaining values in a list can be accessed by utilizing the &lt;code&gt;hd(list)&lt;/code&gt; and &lt;code&gt;tl(list)&lt;/code&gt; functions. Lists are also immutable, meaning the original list can not be edited or changed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex(16)&amp;gt; list = [2, 4, 6, 8]
[2, 4, 6, 8]
iex(17)&amp;gt; hd(list)
2
iex(18)&amp;gt; tl(list)
[4, 6, 8]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;center&gt;
&lt;/center&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--THqobKmG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qbs23imwyzeun4a0xnmk.png" alt="Image description" width="211" height="209"&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
Tuples are somewhat similar to lists. They are represented though, with curly brackets instead of square. They are however, also immutable. The real difference though lies in that lists are sorted in memory as linked lists. This means accessing the end of the list is a linear operation, so we need to travers the entire list to determine its length, or size. Tuples on the other hand are stored contiguously in memory. So accessing an element can be a very quick operation. However adding or updating an element to tuples can be expensive in memory, because it requires creating a new tuple.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex(19)&amp;gt; {"hello", "world!"}
{"hello", "world!"}
iex(20)&amp;gt; tuple = {"hello", "world!"}
{"hello", "world!"}
iex(21)&amp;gt; tuple_size(tuple)
2
iex(22)&amp;gt; elem(tuple, 0)
"hello"
iex(23)&amp;gt; elem(tuple, 1)
"world!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;center&gt;
&lt;/center&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hacEOwZ2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6sn5l0fje3s4qtvlr8zu.png" alt="Image description" width="211" height="209"&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
Finally we arrive at atoms! Atoms are similar to symbols in Ruby, and somewhat similar to defining a variable using the const keyword in JavaScript. Atoms are constants who's name is also their value. In other words, they will always represent what they stand for. Atoms can also represent boolean values as seen below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex(24)&amp;gt; :hello === :hello
true
iex(25)&amp;gt; :hello === :world
false
iex(26)&amp;gt; true === :true
true
iex(27)&amp;gt; is_atom(false)
true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you were wondering what the "iex" is preceding my code, that is the Elixir Interactive Shell. It is the built in shell that allows you to write statements and execute them, resulting in an output.    &lt;/p&gt;

&lt;p&gt;So there are some basic fundamentals to dip your toes into Elixir!&lt;br&gt;
I hope to continue exploring Elixir further and hopefully build some projects using this language in the future.  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;u&gt;Resources:&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.educative.io/blog/elixir-functional-programming"&gt;A beginner's guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://elixir-lang.org/getting-started/basic-types.html"&gt;Getting Started - Basic types&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.educative.io/answers/what-are-the-data-types-in-elixir"&gt;What are the data types in Elixir?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://inquisitivedeveloper.com/lwm-elixir-6/"&gt;Learn With Me: Elixir - Data Types&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>elixir</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Intro to The MERN Stack</title>
      <dc:creator>Samuel Littell</dc:creator>
      <pubDate>Mon, 03 Oct 2022 01:18:49 +0000</pubDate>
      <link>https://dev.to/samlittellmds/intro-to-the-mern-stack-2pe</link>
      <guid>https://dev.to/samlittellmds/intro-to-the-mern-stack-2pe</guid>
      <description>&lt;p&gt;&lt;em&gt;(Cover Image Source: &lt;a href="https://www.mindinventory.com/blog/mean-stack-vs-mern-stack/"&gt;Link&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;While there is a plethora of full stack options and opinions out there, I am choosing to focus on one, in particular, The MERN Stack. I've chosen this particular stack due to it's accessibility and popularity. The MERN Stack is a full, open-source, tech stack. The acronym "MERN" is derived from the group of JavaScript-based frameworks, runtime environments, and databases that make up this specific stack. The stack is comprised of MongoDB &lt;em&gt;(database solution)&lt;/em&gt;, ExpressJS &lt;em&gt;(NodeJS framework)&lt;/em&gt;, React &lt;em&gt;(Frontend browser side JS library)&lt;/em&gt;, and NodeJS &lt;em&gt;(Server-side JS runtime)&lt;/em&gt;. MERN was created to help developers obtain a smooth end-to-end development process. Let's take a closer look at the 4 elements that make up The MERN Stack, and try to understand why it's quickly becoming the more popular stack option among developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;center&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z0dwyDr3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ebkjt9iv4he4hvc8w06.png" alt="Image description" width="152" height="211"&gt;&lt;/center&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;center&gt;&lt;strong&gt;Backend | Database&lt;/strong&gt;&lt;/center&gt;
&lt;/h2&gt;




&lt;p&gt;In order to stay loyal to the order of our "MERN" acronym, let us first take a look at the "M": MongoDB. MongoDB is a NoSQL database engine that allows us to store data in the form of key/value, graph, wide-column stores, or document database models &lt;em&gt;(amongst others)&lt;/em&gt;. MongoDB stores this data natively in the form of BSON data &lt;em&gt;(a binary version of JSON).&lt;/em&gt; Unlike SQL it does not enforce a schema typical to most relational databases. This makes it a flexible and powerful database that can easily be integrated into an ExpressJS/NodeJS environment. Speaking of which, let's take a closer look at the two other backend components of MERN, ExpressJS and NodeJS.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;center&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZlnKfEXx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a0cslz9rxa37vxrlb5y0.png" alt="Image description" width="294" height="204"&gt;&lt;/center&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;center&gt;&lt;strong&gt;Backend | Server&lt;/strong&gt;&lt;/center&gt;
&lt;/h2&gt;




&lt;p&gt;ExpressJS, NodeJS, and MongoDB make up the backend components of MERN, but if we break down the backend even further, we have ExpressJS and NodeJS handling the server-side of the backend, while MongoDb is left handling the database. NodeJS is an asynchronous, event driven, JavaScript runtime often used to create scalable server-side applications. ExpressJS is a minimal and flexible framework for NodeJS. It assists in URL routing and handling HTTP requests and responses. We need NodeJS in order to use ExpressJS, and in turn, ExpressJS is what we use to communicate the backend to the frontend. Which leads us to React, the frontend of The MERN Stack.&lt;/p&gt;


&lt;center&gt;
&lt;h2&gt;
  
  
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BcG6TNqR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pupjxaz8zlkhhzlwka4p.png" alt="Image description" width="144" height="210"&gt;
&lt;/h2&gt;
&lt;/center&gt;

&lt;h2&gt;
  
  
  &lt;center&gt;&lt;strong&gt;Frontend | Web&lt;/strong&gt;&lt;/center&gt;
&lt;/h2&gt;



&lt;p&gt;React is the frontend, client-side framework of MERN which allows developers to build interactive user interfaces. With React we can write JavaScript code that will be executed in the browser, and since it's executed there, it's responsible for controlling what the user sees on their respective devices. React assists in rendering a user interface with dynamic data, and updates the interface accordingly when the data changes, or when certain events occur. Essentially, it takes in user input and provides feedback to the user via visualization. There is a treasure trove of reasons to choose React over other respective frontend libraries, but a few stand-out reasons are the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;React is maintained by talented developers at Facebook.&lt;/li&gt;
&lt;li&gt;React is the most used / most popular frontend framework, which means there is a TON of free and easily attainable resources out there to assist in learning and applying React to your projects.&lt;/li&gt;
&lt;li&gt;React is incredibly flexible: &lt;em&gt;"React code is easier to maintain and is flexible due to its modular structure. This flexibility, in turn, saves a huge amount of time and cost to businesses." - Ubaid Pisuwala of Peerbits.com&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;So in conclusion, how exactly do these MERN technologies work together to create and render a finished application in the real world? Essentially, when a user goes to a particular website or web address, we are going to send the user some files, content, or HTML to appear on the screen. This will be handled by the frontend, or React "side" of our application. React doesn't particularly care, or know what to show to the user. It needs data to show the correct content. So we store that data via MongoDB. In order for React to communicate and pull data from the database we need a middle man, and that is where ExpressJS/NodeJS come in. ExpressJS will contain logic to handle incoming requests from React, pull data from MongoDB based on those requests, and then package and send that data back to React where it is then rendered and the content is displayed on the screen as a finished user interface. &lt;/p&gt;

&lt;p&gt;There you have it. The MERN Stack is a three tier, full-stack solution to all of your application building needs. Understanding how this three tier system flows and works together is understanding how to build better and more efficient applications.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;u&gt;Resources:&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.mongodb.com/mern-stack"&gt;MERN Stack Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.simplilearn.com/tutorials/mongodb-tutorial/what-is-mern-stack-introduction-and-examples"&gt;All You Need To Know About MERN Stack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.peerbits.com/blog/reasons-to-choose-reactjs-for-your-web-development-project.html"&gt;The benefits of ReactJS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://procoders.tech/blog/express-js-vs-node-js/"&gt;Express JS vs Node JS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>fullstack</category>
      <category>react</category>
    </item>
    <item>
      <title>Bootcamp: .Reduce()</title>
      <dc:creator>Samuel Littell</dc:creator>
      <pubDate>Fri, 12 Aug 2022 22:31:55 +0000</pubDate>
      <link>https://dev.to/samlittellmds/bootcamp-reduce-398d</link>
      <guid>https://dev.to/samlittellmds/bootcamp-reduce-398d</guid>
      <description>&lt;p&gt;As an impressionable first time "bootcamper", nearly 2 and a half months into my deep-dive of JavaScript, it's easy to become immediately attracted to shiny objects. Learning hundreds of concepts in such a short period can be overwhelming, but I think it's important to stop and admire what you've come to appreciate as far as those concepts go. I think the reduce method is my shiny object, thus far.&lt;/p&gt;

&lt;p&gt;For me iterating through data was completely foreign. This was not something on my radar. The idea of looping through an array of letters, numbers, words, and "stuff", was not something I was prepared for. Oh, and making it return something after? What? I was ignorant, to put it simply. After learning imperative style for-looping, over and over again, it became clear to me how simple code like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let array = [2, 4, 6, 8];

const sum = (array) =&amp;gt; {
  let result = 0; 
  for (let i = 0; i &amp;lt; array.length; i++) {
    result += array[i];
  }  
  return result;
};

console.log(sum(array)); -&amp;gt; 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;... can quickly get out of hand, especially when we introduce complex code, math, or conditions into the equation. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;center&gt;...&lt;/center&gt;
&lt;/h2&gt;

&lt;p&gt;In comes the Reduce method. It seems like the Reduce method has no limits. It can do what Map, Filter, and many other JavaScript array functions do, AND it just looks better doing it. Take my for-loop example from above for example, let's photoshop it using Reduce:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let array = [2, 4, 6, 8];

const sum = (array) =&amp;gt; array.reduce((total, item) =&amp;gt; total += item, 0);

console.log(sum(array)); -&amp;gt; 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wow. So much cleaner. That's clean. A single line of code that does what you want it do, as opposed to telling it what to do. As a noob I just &lt;em&gt;FEEL&lt;/em&gt; more confident, and maybe, a little less capable of screwing this function up, although I would not put it past me.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;center&gt;...&lt;/center&gt;
&lt;/h2&gt;

&lt;p&gt;Next I will use a coding example that was introduced to me in bootcamp. While I understand the "think outside of the box" type of programming that this toy-problem is forcing upon me, I could not help but be a little annoyed knowing a similar result could be attained with ONLY using the Reduce method. For example, return an array of all of the people who's favorite stuff includes "stuff1", using Reduce AND forEach:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const people = [
    {
      person: 'person1',
      favStuff: ['stuff1', 'stuff2', 'stuff3'],
    },
    {
      person: 'person2',
      favStuff: ['stuff4', 'stuff1', 'stuff5'],
    },
    {
      person: 'person3',
      favStuff: ['stuff6', 'stuff7', 'stuff8'],
    },
    {
      person: 'person4',
      favStuff: ['stuff9', 'stuff1', 'stuff10'],
    }
];


const stuff = (people) =&amp;gt; {
  var newArr = people.reduce(function(arr, curr) {
    curr.favStuff.forEach(function(stuff) {
      if (stuff === 'stuff1') {
        arr.push(curr.person);
      }
    });
    return arr;
  }, []);
  return newArr;
};

console.log(stuff(people)); -&amp;gt; ['person1', 'person2', 'person4']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, I'm not trying to toot my own horn here, this took me a good 25-30 minutes to figure out, mostly because I had tunnel vision. I kept wanting to solve this, only using Reduce, nothing else. I had to convince my brain to solve the problem in this manner... and invite forEach to my party even though it wasn't welcome.&lt;/p&gt;

&lt;p&gt;As I continue through my coding journey, I hope to pick up more tools along the way and hopefully bond with them. I need to search for the positive, and focus less on the many struggles that the coding maze presents to me. Also, before I forget, and my brain explodes from holding it in (and imposter syndrome), here is the "stuff" function using only Reduce:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const stuff = (people) =&amp;gt; {
 let result = people.reduce(function(arr, curr) {
  if (curr.favStuff.includes('stuff1')) {
    arr.push(curr.person);
  }
   return acc;
  }, []);
  return result;
}

console.log(stuff(people)); -&amp;gt; ['person1', 'person2', 'person4']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>reduce</category>
      <category>beginners</category>
      <category>toyproblem</category>
    </item>
  </channel>
</rss>
