<?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: Nashmeyah</title>
    <description>The latest articles on DEV Community by Nashmeyah (@nashmeyah).</description>
    <link>https://dev.to/nashmeyah</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%2F518650%2Fd93615d1-dcfe-4c45-91b1-2a7a0133fc03.jpeg</url>
      <title>DEV Community: Nashmeyah</title>
      <link>https://dev.to/nashmeyah</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nashmeyah"/>
    <language>en</language>
    <item>
      <title>Data Structure: Binary Tree</title>
      <dc:creator>Nashmeyah</dc:creator>
      <pubDate>Fri, 03 Dec 2021 04:50:36 +0000</pubDate>
      <link>https://dev.to/nashmeyah/data-structure-binary-tree-nga</link>
      <guid>https://dev.to/nashmeyah/data-structure-binary-tree-nga</guid>
      <description>&lt;p&gt;Hello All! &lt;br&gt;
(all the photos used are from google btw)&lt;/p&gt;

&lt;p&gt;Its been a while, I hope you all are doing well.&lt;/p&gt;

&lt;p&gt;In this post, I wanted to share some basic knowledge of trees in programming and data structures.&lt;/p&gt;

&lt;p&gt;We are starting with the trees. A tree is a data structure used to simulate a hierarchical tree structure. A node of the tree has a root value and a list of references to other nodes which are referred to as child nodes.&lt;br&gt;
The most typical tree structure used is the Binary tree. As the name suggests, each node of the binary tree has at most two children referred to as left child and right child.&lt;/p&gt;

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

&lt;p&gt;Notice the image above to understand a visual representation of how this looks like.&lt;/p&gt;

&lt;h1&gt;
  
  
  Traversal Methods used in a Binary Tree
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Def. of Traverse ~ travel across or through.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Pre-order Traversal&lt;br&gt;
 --Pre-order traversal is to visit the root first. Then traverse the left subtree. Finally, traverse the right subtree.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rGpqrzGR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i89qdmtd07qcba63d1wf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rGpqrzGR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i89qdmtd07qcba63d1wf.png" alt="Image description" width="880" height="457"&gt;&lt;/a&gt;&lt;br&gt;
 The red indicates that we return from the visit on the node to move to the next node, but continue to move down on all left nodes. &lt;/p&gt;

&lt;p&gt;In-order Traversal&lt;br&gt;
 --In-order traversal is to traverse the left subtree first. Then visit the root. Finally, traverse the right subtree&lt;/p&gt;

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

&lt;p&gt;In a binary search tree, all data is retrieved in a sorted order using in-order traversal.&lt;/p&gt;

&lt;p&gt;Post-order Traversal&lt;br&gt;
 --Traverse the left subtree first. Then traverse the right subtree. Finally, visit the root.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QJgN3sL1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ipm2wmzajvulwx54uww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QJgN3sL1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ipm2wmzajvulwx54uww.png" alt="Image description" width="687" height="616"&gt;&lt;/a&gt;&lt;br&gt;
Personally I think this one is a bit hard foe me to wrap my head around. Spend some time running the numbers back in your head and understand the map.&lt;/p&gt;

&lt;p&gt;I hope this makes sense and simplified the Binary Tree. Next post I'd like to cover recursions using one of these traverse methods.&lt;/p&gt;

&lt;p&gt;When you delete nodes in a tree, deletion process will be in post-order, when you delete a node, you will delete its left child and its right child before you delete the node itself.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>algorithms</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Difference between language, framework and library </title>
      <dc:creator>Nashmeyah</dc:creator>
      <pubDate>Mon, 24 May 2021 05:48:31 +0000</pubDate>
      <link>https://dev.to/nashmeyah/difference-between-language-framework-and-library-3949</link>
      <guid>https://dev.to/nashmeyah/difference-between-language-framework-and-library-3949</guid>
      <description>&lt;p&gt;Hello All!&lt;/p&gt;

&lt;p&gt;Today I thought to talk about the difference between library, framework and language as many junior developers think they are one and the same. &lt;/p&gt;

&lt;h1&gt;
  
  
  Language
&lt;/h1&gt;

&lt;p&gt;First and for most, Language is is a set of commands, directions, and different syntax used to form a software program. It is what’s used to give the computer directions in order to meet our goals.&lt;/p&gt;

&lt;p&gt;Examples include:  Python, JavaScript, C#, Ruby, Swift, Go..etc&lt;/p&gt;

&lt;h1&gt;
  
  
  Framework
&lt;/h1&gt;

&lt;p&gt;A framework is a platform for development, providing foundations on which you as the developer can build on. Think of it like a canvas, its ready for you to just paint on. &lt;/p&gt;

&lt;p&gt;The difference between library and framework is what’s called inversion of control. Library allows you to control where you want to put and build your code, while a framework is already in set of the flow and has places already set for you to place your code.&lt;/p&gt;

&lt;p&gt;Examples Include: Ruby on Rails, Angular, Vue, Express, Bootstrap, Drupal...etc.&lt;/p&gt;

&lt;h1&gt;
  
  
  Library
&lt;/h1&gt;

&lt;p&gt;Library is an easy one, it is literally a library that holds a collection of objects, functions, methods... anything to make your code easier to build and less clutter. They are written by other developers to make your life easier and saves you time for coding. Easy right!&lt;/p&gt;

&lt;p&gt;I hope this helps!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>First Python Project</title>
      <dc:creator>Nashmeyah</dc:creator>
      <pubDate>Mon, 17 May 2021 05:43:48 +0000</pubDate>
      <link>https://dev.to/nashmeyah/first-python-project-3j96</link>
      <guid>https://dev.to/nashmeyah/first-python-project-3j96</guid>
      <description>&lt;p&gt;Hello World!!&lt;/p&gt;

&lt;p&gt;Let's start making the first Python project on your machine!&lt;/p&gt;

&lt;p&gt;Step 1) Open PyCharm Editor. You can see the introductory screen for PyCharm, click on “Create New Project”.&lt;/p&gt;

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

&lt;p&gt;Step 2) You will need to select a location.&lt;/p&gt;

&lt;p&gt;You can select the location where you want the project to be created.&lt;/p&gt;

&lt;p&gt;Next, click the “Create” Button.&lt;/p&gt;

&lt;p&gt;Step 3) Now Go up to the “File” menu and select “New”. Next, select “Python File”.&lt;/p&gt;

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

&lt;p&gt;Step 4) A new pop-up will appear. Now type the name of the file you want (Here we give “HelloWorld!”) and hit “OK”.&lt;/p&gt;

&lt;p&gt;Step 5) Now type a simple program - print (‘Hello World!’).&lt;/p&gt;

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

&lt;p&gt;Now Go up to the “Run” menu and select “Run” to run your program.&lt;/p&gt;

&lt;p&gt;There you have it!!! Your first program in Python! Simple right? Now imagine the world of things you can do with just this information and the things you can build. &lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>Setting up Python on Windows</title>
      <dc:creator>Nashmeyah</dc:creator>
      <pubDate>Mon, 10 May 2021 05:39:52 +0000</pubDate>
      <link>https://dev.to/nashmeyah/setting-up-python-on-windows-4elf</link>
      <guid>https://dev.to/nashmeyah/setting-up-python-on-windows-4elf</guid>
      <description>&lt;p&gt;Recently I have been learning Python. I learned Java in college but it seems that Python is more used in tech industries. As my first post about Python, I will start by talking about how to set it up on Windows. I learned that there are 3 different ways to install it on your system. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Microsoft Store&lt;/li&gt;
&lt;li&gt;The full installer&lt;/li&gt;
&lt;li&gt;Windows Subsystem for Linux&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this article, I will introduce how to set it up using the Microsoft store. First, check if your system already has Python installed.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Press the Win key.
Type PowerShell.
Press Enter. 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then in your command line type &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python --version
//Python 3.8.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;if you see a response that is the current version installed on your machine. &lt;/p&gt;

&lt;h1&gt;
  
  
  Installing Python from Windows store
&lt;/h1&gt;

&lt;p&gt;Step 1: Open the Python App Page in the Microsoft Store&lt;br&gt;
Open the Microsoft Store app and search for Python.&lt;/p&gt;

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

&lt;p&gt;Select Python the highest version number you see available in the app, to open the installation page. Continue with all the setup instructions and you should have Python ready on the machine.&lt;/p&gt;

&lt;p&gt;Another tip from reading countless articles is to install Pycharm. PyCharm is a cross-platform IDE that provides consistent experience on the Windows, macOS, and Linux operating systems. Here is the link to the website to set it all up.&lt;br&gt;
&lt;a href="https://www.jetbrains.com/help/pycharm/installation-guide.html"&gt;https://www.jetbrains.com/help/pycharm/installation-guide.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope you enjoyed it, please let me know if you have any questions or concerns about setting up Python and I will aid as much as I can. &lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>Sass: @use</title>
      <dc:creator>Nashmeyah</dc:creator>
      <pubDate>Mon, 26 Apr 2021 05:35:05 +0000</pubDate>
      <link>https://dev.to/nashmeyah/sass-use-4lip</link>
      <guid>https://dev.to/nashmeyah/sass-use-4lip</guid>
      <description>&lt;p&gt;I wrote a blog about using @import with your SASS projects to use variables and information from another file within your projects. There is another way to achieve this and that is with using @use.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"The @use rule loads mixins, functions, and variables from other Sass stylesheets, and combines CSS from multiple stylesheets together. Stylesheets loaded by @use are called "modules". Sass also provides built-in modules full of useful functions."(Sass, Online Docs. 2021)&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;I am using this image straight from the Sass website. It clearly shows how to incorporate &lt;em&gt;use&lt;/em&gt; into your files.  &lt;/p&gt;

&lt;p&gt;Think of it this way, When speaking to your computer, you have organized your style sheets and all that wonderful glory, in your main style sheet that you want sass to run, say "hey I want you to &lt;em&gt;USE&lt;/em&gt; my code style sheet found in the foundation folder (i.e. "foundation/_folder.sass") and also the lists style found within the same folder ("foundation/_lists.sass"). Just as a review, the underbar right before the file name tells the computer to ignore that file and not run it with the projects unless stated otherwise. &lt;/p&gt;

&lt;p&gt;Now you may be wondering what is the difference between using &lt;em&gt;use&lt;/em&gt; and &lt;em&gt;import&lt;/em&gt;. Well fundamentally they both do the same thing, but the main difference between the two is that &lt;em&gt;import&lt;/em&gt; makes every variable globally accessible in the target file.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Import enables an endless chain of imported files where it's difficult to trace where your variables and mixins are coming from. It also allows for overlap and makes it difficult to trace back why your perfect css breaks. This is a problem especially with complex file structures and projects with multiple contributors and global libraries, which is why @import is no longer recommended by Sass."(liquidlight.co.uk, Minna Ylitalo 2020. online docs. 2021)&lt;/em&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>programming</category>
      <category>design</category>
    </item>
    <item>
      <title>Setting up a Ruby on Rails Project</title>
      <dc:creator>Nashmeyah</dc:creator>
      <pubDate>Mon, 19 Apr 2021 05:32:40 +0000</pubDate>
      <link>https://dev.to/nashmeyah/setting-up-a-ruby-on-rails-project-2cg7</link>
      <guid>https://dev.to/nashmeyah/setting-up-a-ruby-on-rails-project-2cg7</guid>
      <description>&lt;p&gt;Before setting up a Ruby on Rails project, you have to make sure that you have the latest version installed on your machine. If you have Ruby installed, check the version by typing &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ruby -v
// then type 
gem --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you get an error that means you don't have Ruby, download the installation package from &lt;a href="https://rubyinstaller.org/"&gt;https://rubyinstaller.org/&lt;/a&gt;. Follow the link and then run the installer.&lt;/p&gt;

&lt;p&gt;Now that's done, its time to set up the Rails installation,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gem install rails
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Create a new repo on GitHub. Clone the repo in your command line, within the directory you want to type this line of code,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rails new *name of your app or project*
// ex: rails new myProject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now after you open your vscode, you can start the rails server to see your work live with the command&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rails server // or rails s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Optional
&lt;/h1&gt;

&lt;p&gt;The above steps set you up with blank files and folders so you can start building from scratch. But, there is an option where you can scaffold folders and files for an already setup MVC structure with a database as well.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rails generate scaffold Project name:string 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;That's it! Youre all set up with the bare bones of a Ruby on Rails application. Let me know if there are any other clarifications you would like me to go over! Enjoy!&lt;/p&gt;

</description>
      <category>devjournal</category>
      <category>rails</category>
      <category>ruby</category>
    </item>
    <item>
      <title>JavaScript Tricks - part 2</title>
      <dc:creator>Nashmeyah</dc:creator>
      <pubDate>Mon, 12 Apr 2021 05:40:00 +0000</pubDate>
      <link>https://dev.to/nashmeyah/javascript-tricks-part-2-2i7o</link>
      <guid>https://dev.to/nashmeyah/javascript-tricks-part-2-2i7o</guid>
      <description>&lt;p&gt;Hi Guys! So I found a couple more JS tricks I wanted to share with you guys!&lt;/p&gt;

&lt;h1&gt;
  
  
  Length
&lt;/h1&gt;

&lt;p&gt;When you want to resize an array and set it to 0 or erase your whole array maybe needing to start fresh. Here is a simple way you can do it. &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let array = [1, 9, 42, 4, 90];  
console.log(array.length); // 5  

array.length = 4;  
console.log(array.length); // 4 -- it removes the last element  
console.log(array); // [1,9,42,4]

array.length = 0;  
console.log(array.length); // 0  -- we are at 0
console.log(array); // []
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Query String Params
&lt;/h1&gt;

&lt;p&gt;I loved this one, reminded me of when I went crazy for days trying to get params data.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let urlParams = new URLSearchParams(window.location.search);

console.log(urlParams.has('post')); // true
console.log(urlParams.get('action')); // "edit"
console.log(urlParams.getAll('action')); // ["edit"]
console.log(urlParams.toString()); // "?post=1234&amp;amp;action=edit"
console.log(urlParams.append('active', '1')); // "? 
post=1234&amp;amp;action=edit&amp;amp;active=1"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Array, Boolean
&lt;/h1&gt;

&lt;p&gt;Want to get rid of all the falsey values in an array, just pass Boolean to a .filter() method.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myArray
.map(item =&amp;gt; {
    // ...
})
// Get rid of bad values
.filter(Boolean);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Disclaimer! These are not tricks I figured out myself, social media is a wonderful place! Enjoy!&lt;/p&gt;

</description>
      <category>devjournal</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>JavaScript Tricks</title>
      <dc:creator>Nashmeyah</dc:creator>
      <pubDate>Mon, 05 Apr 2021 05:38:46 +0000</pubDate>
      <link>https://dev.to/nashmeyah/javascript-tricks-1p60</link>
      <guid>https://dev.to/nashmeyah/javascript-tricks-1p60</guid>
      <description>&lt;p&gt;Hey Guys!&lt;/p&gt;

&lt;p&gt;Here are a few JS tricks I learned online, I thought id share a few with you all. &lt;/p&gt;

&lt;h1&gt;
  
  
  Console.table()
&lt;/h1&gt;

&lt;p&gt;When you have an array and you want to display the data, instead of it looking like this,&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HwEWuvyz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/anwkwct4mafydlycm04v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HwEWuvyz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/anwkwct4mafydlycm04v.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It can look cleaner like this,&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2f4J7r1P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zdcxhdjlncb1jsv3e5d2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2f4J7r1P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zdcxhdjlncb1jsv3e5d2.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the difference is the first one was used with console.log() and the second was used with console.table().&lt;/p&gt;

&lt;h1&gt;
  
  
  Conditionals
&lt;/h1&gt;

&lt;p&gt;Within your code, you're likely going to use and if statement, now of course with this tip you'll want to use it carefully because we always want our code to be readable for other viewers. So in your code if you a simple if statement, you can use what is called a ternary operator.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (tired) {
  sleep();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;can be changed to,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hungry &amp;amp;&amp;amp; goToFridge()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;or,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if(age &amp;gt; 5){
  kindergarten()
}else{
  firstGrade()
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;transformed to this,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;age &amp;gt; 5 ? kindergarten() : firstGrade()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Filtering for unique objects
&lt;/h1&gt;

&lt;p&gt;Now we all know how many times we have had to filter out for unique elements, here is a trick using the Set object. "The Set object lets you store unique values of any type, whether primitive values or object references."(MDN, Online Doc)&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const my_array = [1, 7, 2, 2, 3, 1, 4, 6, 5, 7, 8, 9, 1, 2, 4]
const unique_array = [...new Set(my_array)];
console.log(unique_array); // [1, 2, 3, 4, 5, 6, 7, 8, 9]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Thank you for enjoying my blog, I will post more tips more in the future if this was helpful. Once again, please let me know if there is anything you would like me to write about. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>devjournal</category>
      <category>programming</category>
    </item>
    <item>
      <title>Undefined vs. Null vs. Undeclared </title>
      <dc:creator>Nashmeyah</dc:creator>
      <pubDate>Mon, 29 Mar 2021 05:13:57 +0000</pubDate>
      <link>https://dev.to/nashmeyah/undefined-vs-null-vs-undeclared-9f8</link>
      <guid>https://dev.to/nashmeyah/undefined-vs-null-vs-undeclared-9f8</guid>
      <description>&lt;p&gt;A typical JavaScript interview question asks "What is the difference between a variable that is: null, undefined and undeclared?"&lt;/p&gt;

&lt;p&gt;Lets break each one down and understand what each one means and how it relates to programming.&lt;/p&gt;

&lt;h1&gt;
  
  
  Null:
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;"The value null represents the intentional absence of any object value. It is one of JavaScript's primitive values and is treated as falsy for boolean operations."&lt;/em&gt; (MDN Web Docs, Online). Null means that the value is absent, not 0... the value points to no object.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = null;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Undefined:
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;"The undefined property indicates that a variable has not been assigned a value, or not declared at all."&lt;/em&gt;, (W3Schools, Online). &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x
console.log(x + "test")
// x is undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Undeclared:
&lt;/h1&gt;

&lt;p&gt;Variables that have been declared without using const, var, or let. For Example:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;testVar = "This is undeclared"
// as opposed to
let testVar = "This is declared"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now lets discuss the differences between all three. Null is pointing to nothing in memory. Undefined is a variable that has not been assigned any value. Lastly, undeclared is a variable that has not been properly declared using const, var, or let.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Sass: @import</title>
      <dc:creator>Nashmeyah</dc:creator>
      <pubDate>Mon, 22 Mar 2021 04:53:30 +0000</pubDate>
      <link>https://dev.to/nashmeyah/sass-import-1abm</link>
      <guid>https://dev.to/nashmeyah/sass-import-1abm</guid>
      <description>&lt;p&gt;Hi Guys! Lets talk about files and file structures using Sass.&lt;/p&gt;

&lt;p&gt;When organizing your web design style files, you don't want to put all the styles into one file. Think when you are building a massive web application, you will have to sift through thousands of lines of code to style or change one thing. &lt;/p&gt;

&lt;p&gt;Here is an example on how to best organize your files.&lt;/p&gt;

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

&lt;p&gt;Notice how the master.scss file is the only one that does not have the underscore at the beginning of the filename. This means that everything with an underscore is a partial file and should not be generated into a css file. In the html file, when you link the style sheet, the master style sheet will be the main one used and generated.&lt;/p&gt;

&lt;p&gt;The files that are partial files when you want to use them into the master, you simply use @import at the top of the file. For example, if you have a _variables.scss file that stores all the variables you set for styling, you would import it at the top of the master or any other file you want to use using one line of code.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@import "variables";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I hope this helped, let me know if you'd like me to cover anything else regarding scss.&lt;/p&gt;

</description>
      <category>css</category>
      <category>programming</category>
      <category>webdev</category>
      <category>design</category>
    </item>
    <item>
      <title>Closures</title>
      <dc:creator>Nashmeyah</dc:creator>
      <pubDate>Mon, 15 Mar 2021 05:39:32 +0000</pubDate>
      <link>https://dev.to/nashmeyah/closures-4l14</link>
      <guid>https://dev.to/nashmeyah/closures-4l14</guid>
      <description>&lt;p&gt;What is a closure?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function’s scope from an inner function. In JavaScript, closures are created every time a function is created, at function creation time."&lt;/em&gt; (MDN Web Docs, online)&lt;/p&gt;

&lt;p&gt;In other words, a closures control what is and isn't in a scope for a function. A closure gives you access to an outer functions scope from within the function you are currently working in. The inner function will have access to the variables and objects from the outer functions scope. &lt;/p&gt;

&lt;p&gt;Some examples of simple closures.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function increment() {

let i = 0;

  return function() {

    return i++;

  }

}

let addUp = increment();
//addUp() 0
//addUp() 1
//addUp() 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In this example, out inner function is pulling data from outside its scope and accessing a variable from the outer function.&lt;/p&gt;

&lt;p&gt;Here is another example.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let num = 5;

const addTo = function(){
  let inner = 2;
  return num + inner;
}
console.log(addTo());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In this example, 1 function is accessing a global variable from within the functions scope.&lt;/p&gt;

&lt;p&gt;I hope you enjoyed this blog, have a wonderful day&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>devjournal</category>
      <category>programming</category>
    </item>
    <item>
      <title>Setting up SASS</title>
      <dc:creator>Nashmeyah</dc:creator>
      <pubDate>Mon, 08 Mar 2021 03:58:58 +0000</pubDate>
      <link>https://dev.to/nashmeyah/setting-up-sass-4gia</link>
      <guid>https://dev.to/nashmeyah/setting-up-sass-4gia</guid>
      <description>&lt;p&gt;Hey Guys and Gals!&lt;/p&gt;

&lt;p&gt;Currently I am working on a little somethin' somethin' and for the first time I had to start using Sass! So, of course I thought of writing a blog on setting up.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Set up a package.json file so that you can alter Sass settings.&lt;/p&gt;

&lt;p&gt;npm init&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install Sass&lt;/p&gt;

&lt;p&gt;npm install node-sass&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Inside the package.json file, (on windows) press ctrl+f and search sass, there you will find it as part of the packages installed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;VS Code Extension or npm.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here you will have to decide whether you want to install the extension on your VS Code then run sass server which you can find it by typing Live Sass Compiler in the extensions and install it. On the lower right hand side, you can click watch sass and that will start the server. Or, you can alter the package.json file and run the sass through the terminal.&lt;/p&gt;

&lt;p&gt;locate this in the package.json file,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
"test": "echo \"Error: no test specified\" &amp;amp;&amp;amp; exit 1"
},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;change "test" to "sass" and add the following,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
"sass": "node-sass -w scss/ -o css/ --recursive"
},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;now you can run the sass script through your terminal by typing this command&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run sass
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>design</category>
    </item>
  </channel>
</rss>
