<?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: Weevil</title>
    <description>The latest articles on DEV Community by Weevil (@weevil).</description>
    <link>https://dev.to/weevil</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%2F918614%2Fc5456e91-7a2a-4659-9161-836427699b0f.png</url>
      <title>DEV Community: Weevil</title>
      <link>https://dev.to/weevil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/weevil"/>
    <language>en</language>
    <item>
      <title>Underscore.js... Makes Your sorting Life unimaginably Easy</title>
      <dc:creator>Weevil</dc:creator>
      <pubDate>Thu, 01 Sep 2022 11:07:22 +0000</pubDate>
      <link>https://dev.to/weevil/underscorejs-makes-your-sorting-life-unimaginably-easy-456i</link>
      <guid>https://dev.to/weevil/underscorejs-makes-your-sorting-life-unimaginably-easy-456i</guid>
      <description>&lt;p&gt;...lately this week I was given a task to work SWAPI (starwarsapi)... and this api is kinda complex than anything I have worked on before... now listen, not complex at first, but the task made it complex;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetch a list of films from the SWAPI -(easy pissy!😒 rii) &lt;/li&gt;
&lt;li&gt;&lt;p&gt;Movie names in the dropdown to be sorted by release date from earliest to newest (not bad init?😊) &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There should be no movie selected initially and the app should&lt;br&gt;
show the Star Wars logo instead of movie information (just set and initial state ? 🥱) &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The opening crawl of the selected movie should be&lt;br&gt;
animated, a simple scrolling marquee text would be&lt;br&gt;
sufficient😎&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;.... Problem begins... considering the fact that I didn't plan quite while before dabbling into the task, all the planning w sin my head tho little... this last part got me sleepless..&lt;/p&gt;

&lt;p&gt;● All characters that appear in that movie should be listed&lt;br&gt;
showing name, gender, and height in the form of a table.&lt;/p&gt;

&lt;p&gt;● Gender can be shown as an icon or abbreviation to save&lt;br&gt;
horizontal space. Character list can be sorted by clicking on the&lt;br&gt;
table headers.&lt;/p&gt;

&lt;p&gt;● Clicking on the same header twice toggles the sort order by the&lt;br&gt;
field between ascending and descending.&lt;/p&gt;

&lt;p&gt;● There should also be a gender filter selection right above the list so that either all characters are listed or only the selected gender are listed.&lt;/p&gt;

&lt;p&gt;● The last row of the table should show the total number of&lt;br&gt;
characters currently visible on the list.&lt;/p&gt;

&lt;p&gt;● The last row should also show the sum of the heights of the&lt;br&gt;
characters currently visible.&lt;/p&gt;

&lt;p&gt;● The sum of heights should be shown both in cm and in&lt;br&gt;
feet/inches in parenthesis, for example, 170 cm (5ft/6.93in)&lt;/p&gt;

&lt;p&gt;....Looking at the above task, I finally completed the task in 3days, what I estimated to take me only 6-10hours, after many #stack-overflow copy and paste, trials and errors, I came across the _js (&lt;strong&gt;&lt;a href="https://www.npmjs.com/package/underscore"&gt;Underscore js&lt;/a&gt;&lt;/strong&gt;) at Stack overflow, someone was answering a question similar to what I was facing currently performing the task... and man, I have never been this happy before finding a solution.&lt;/p&gt;

&lt;p&gt;It helped as a utility-belt library for JavaScript that provides support for the usual functional suspects (each, map, reduce, filter...) without extending any core JavaScript objects.&lt;/p&gt;

&lt;p&gt;After the 3day ling struggle underscore Js came to my rescue... &lt;/p&gt;

&lt;p&gt;Nice!😊 &lt;br&gt;
Thanks for reading...&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>underscorejs</category>
    </item>
  </channel>
</rss>
