<?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: Orim Dominic Adah</title>
    <description>The latest articles on DEV Community by Orim Dominic Adah (@orimdominic).</description>
    <link>https://dev.to/orimdominic</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%2F144256%2F8082bcca-8a0c-41c3-89fe-3e5e0fcdadf6.jpg</url>
      <title>DEV Community: Orim Dominic Adah</title>
      <link>https://dev.to/orimdominic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/orimdominic"/>
    <language>en</language>
    <item>
      <title>Accepted Into Enye Cohort 5</title>
      <dc:creator>Orim Dominic Adah</dc:creator>
      <pubDate>Fri, 12 Sep 2025 13:56:58 +0000</pubDate>
      <link>https://dev.to/orimdominic/accepted-into-enye-cohort-5-55ib</link>
      <guid>https://dev.to/orimdominic/accepted-into-enye-cohort-5-55ib</guid>
      <description>&lt;h2&gt;
  
  
  Welcome to Enye Cohort 5 [Feb 8, 12:25 AM]
&lt;/h2&gt;

&lt;p&gt;I saw the mail some minutes after midnight while making fixes to an app I was building. I had kept my mail tab open because Mr. &lt;a href="https://www.linkedin.com/in/nnadi" rel="noopener noreferrer"&gt;Uche Nnandi&lt;/a&gt; had promised us via the Slack group that we'd get mails that weekend. I smiled when I saw it, and then I laughed, and then, I relaxed.&lt;/p&gt;

&lt;h2&gt;
  
  
  ...before now
&lt;/h2&gt;

&lt;p&gt;I had applied for &lt;a href="https://enye.tech" rel="noopener noreferrer"&gt;Enye&lt;/a&gt; cohort 2 and 4 internships. I didn't continue with the application. I was either very busy with deliverables, or I felt that I could not complete the task before the deadline.&lt;/p&gt;

&lt;p&gt;I got a mail from the Enye team on Jan 15 informing me that the Enye cohort 5 internship was open for applications. The benefits of participating in the internship were listed, and I was more interested and willing than I ever was. I had more free time and as a self-taught developer, I needed a process that would put me through building software using the proper tools and processes. I applied and told my friends to apply too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Phase One
&lt;/h2&gt;

&lt;p&gt;I was sent a link to the first task and I was asked to submit it in 5 days. The purpose of the task was for the Enye team to gauge applicants' understanding of 'working with JSON data and RESTful APIs, and to gauge applicants' understanding of user experience in frontend development' too.&lt;/p&gt;

&lt;p&gt;It was an interesting two-part task that required applicants to develop and deploy a frontend application that displays data from an API beautifully well and a backend application that returns currency rates based on requests from a client.&lt;/p&gt;

&lt;p&gt;I set a deadline for myself to submit before the deadline, and I did. I put in a lot, but I didn't expect much. No thanks to rejection letters with poor user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Phase Two
&lt;/h2&gt;

&lt;p&gt;I received a congratulatory mail that my submission was accepted, &lt;code&gt;202&lt;/code&gt;. I was also added to a private channel on the Slack group for applicants whose phase one submission had been accepted.&lt;/p&gt;

&lt;p&gt;The task for the second phase was to ace the cut-off mark on a multiple-choice questions test about JavaScript, React and, Node.js. I was to take the test  whenever I felt comfortable.&lt;/p&gt;

&lt;p&gt;Like the first task, I tried what I could, but unlike it, I was a tad hopeful. Even at that, I choose to not pay much attention to receiving a congratulatory mail; to numb the effect of mails that hurt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Phase Three
&lt;/h2&gt;

&lt;p&gt;I got another congratulatory mail informing me that I had passed the phase two test. This mail came with a test attached. What's that maxim again? &lt;em&gt;The reward for good work is more work&lt;/em&gt; init?&lt;/p&gt;

&lt;p&gt;This test hit me and stretched me, but I loved it. It required applicants to do the following for an application that was described:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;create user story mapping diagrams using &lt;a href="https://miro.com/" rel="noopener noreferrer"&gt;Miro&lt;/a&gt;,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;create a UI design using &lt;a href="https://figma.com" rel="noopener noreferrer"&gt;Figma&lt;/a&gt;,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;describe and design a standard API documentation for the application using &lt;a href="https://swagger.io/" rel="noopener noreferrer"&gt;Swagger&lt;/a&gt;,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;leverage &lt;a href="https://www.lucidchart.com" rel="noopener noreferrer"&gt;Lucid Chart&lt;/a&gt; to create entity relationship diagrams for the database entities of the application,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;list and describe the various APIs, deployment platforms, frameworks, libraries, and other tech that will be needed to build the application; state the advantages and disadvantages of the chosen tech, state the reason for choosing it over its competitors, and also state how relevant the chosen tech is to the development of the application,&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;in five days. All these in five days!&lt;/p&gt;

&lt;p&gt;What really got me interested in this task was that I had an idea to build this particular application the year before, but I didn't know what (best and free-tier) tools to build it with. I also didn't know how best to architect it. After reading the task description, I said to myself &lt;em&gt;What you've been pushing away has finally hugged you tight&lt;/em&gt;. I've built apps, but I didn't follow this process.&lt;/p&gt;

&lt;p&gt;I hadn't used any of these tools before, except Figma. I wrote user stories for apps I built, but I'd never arranged them into activities, tasks and stories and placed them into sprints. I spent two days (thank you PHCN) learning the proper format for user story mappings.&lt;/p&gt;

&lt;p&gt;Creating the standard APIs using Swagger became less stressful and faster for me when I learnt about components. The user experience in using Miro was awesome and it helped. That I had this application in mind before I was assigned this task made creating the entity-relationship diagram easier for me.&lt;/p&gt;

&lt;p&gt;I put a lot of work into the justification for the technologies to be used in building out the application. My idea was that, even if I didn't pass to the next phase, I'd have learnt what tech to use to build the app myself.&lt;/p&gt;

&lt;p&gt;I did not finish the Figma design task, and I wasn't bothered much. One of the instructions on the task read &lt;strong&gt;You will be judged based on the quality of your work&lt;/strong&gt;. I felt confident that the focus was on attention to detail and quality, not quantity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Video Interview
&lt;/h2&gt;

&lt;p&gt;The congratulatory mail for passing the phase three test came with a request for a recorded video with answers to interview questions that verified my soft skills and had to be submitted in three days.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;The experience was awesome. Even if I hadn't been selected, I'd still be happy I went through the process and here are my reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The Enye team was supportive throughout the application period, and the grading processes were relatively fast. I got response mails in less than a week&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The tasks were clear, straightforward, and involved real-life tasks. They also inspired autonomy. The Enye team made sure that applicants were never hand-held in completing their tasks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I believe the process was fair. If it wasn't, someone would have complained on the Slack channel. Although I never asked for feedback, I believe that some applicants received feedback on their submitted tasks when they asked.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The process wasn't focused on filtering out applicants. Those who didn't make it to the selected 30 were put on a waitlist as replacements, in the event that someone from the selected 30 wasn't interested in the internship.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you Enye. I look forward to working with the founders and engineers who I'll be matched with during the internship. I look forward to creating magic with you all!&lt;/p&gt;

</description>
      <category>career</category>
      <category>devjournal</category>
      <category>motivation</category>
    </item>
    <item>
      <title>What do you do while waiting?</title>
      <dc:creator>Orim Dominic Adah</dc:creator>
      <pubDate>Fri, 28 Feb 2020 03:21:03 +0000</pubDate>
      <link>https://dev.to/orimdominic/share-what-you-do-while-waiting-with-the-dev-community-18im</link>
      <guid>https://dev.to/orimdominic/share-what-you-do-while-waiting-with-the-dev-community-18im</guid>
      <description>&lt;p&gt;We've all been there and we'll never stop being there. Times like when &lt;code&gt;npm install&lt;/code&gt; takes forever, long running test suites we hope all pass and the infamous Gradle builds that take longer than the Shawshank Redemption with commercials.&lt;/p&gt;

&lt;p&gt;What do you do during these times?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Play swords with a colleague?&lt;/li&gt;
&lt;li&gt;Surf dev.to?&lt;/li&gt;
&lt;li&gt;Watch Youtube videos?&lt;/li&gt;
&lt;li&gt;Pet your pet?&lt;/li&gt;
&lt;li&gt;Snapchat?&lt;/li&gt;
&lt;li&gt;Take a walk?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Share what you do in these wait times that holds you back from exploding with anxiety! Lets all learn and have fun. Someone might just adopt yours! 😉&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>fun</category>
      <category>share</category>
    </item>
    <item>
      <title>Kindly share the work/life related website(s) you never fail to visit everyday, and why</title>
      <dc:creator>Orim Dominic Adah</dc:creator>
      <pubDate>Tue, 18 Feb 2020 00:38:55 +0000</pubDate>
      <link>https://dev.to/orimdominic/kindly-share-the-work-life-related-website-s-you-never-fail-to-visit-everyday-and-why-8im</link>
      <guid>https://dev.to/orimdominic/kindly-share-the-work-life-related-website-s-you-never-fail-to-visit-everyday-and-why-8im</guid>
      <description>&lt;p&gt;Everyone has that dev, work or life related website they never fail to visit EVERY DAY of their dev life. It could be &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://stackoverflow.com" rel="noopener noreferrer"&gt;StackOverflow&lt;/a&gt; for answers to their dev-related questions,&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to"&gt;Dev.to&lt;/a&gt; for articles containing solutions to work and work-life challenges, and fun stuff,&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.hackerrank.com/" rel="noopener noreferrer"&gt;Hackerank&lt;/a&gt; for coding challenges and jobs,&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.toptal.com/" rel="noopener noreferrer"&gt;Toptal&lt;/a&gt; for freelancing jobs,&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.codepen.io/" rel="noopener noreferrer"&gt;Codepen&lt;/a&gt;,&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.freecodecamp.org/" rel="noopener noreferrer"&gt;FreeCodeCamp&lt;/a&gt;,&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;or any other one.&lt;/p&gt;

&lt;p&gt;Kindly share with us and tell us why that website is a daily go-to for you. You never know.. You may win someone over to that website through its usefulness to you🤷‍♀️😉&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>fun</category>
    </item>
    <item>
      <title>What are your basic metrics for judging a website as a Product Manager or Developer?</title>
      <dc:creator>Orim Dominic Adah</dc:creator>
      <pubDate>Tue, 11 Feb 2020 04:06:43 +0000</pubDate>
      <link>https://dev.to/orimdominic/what-are-your-basic-metrics-for-judging-a-website-as-a-product-manager-or-developer-5eij</link>
      <guid>https://dev.to/orimdominic/what-are-your-basic-metrics-for-judging-a-website-as-a-product-manager-or-developer-5eij</guid>
      <description>&lt;p&gt;Every website development project has its requirements. A lot of times, these requirements come from the purpose of the website. &lt;/p&gt;

&lt;p&gt;That being said, there are some basic requirements we expect some web development projects to have as product managers or developers. These may include&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SEO friendliness&lt;/li&gt;
&lt;li&gt;Low time-to-first-byte (TTFB)&lt;/li&gt;
&lt;li&gt;Low time-to-first-interaction (TTFI)&lt;/li&gt;
&lt;li&gt;Accessibility&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Others may include PWA, performance-related metrics and so on.&lt;/p&gt;

&lt;p&gt;What are the basic standards you try to meet when you have a web development project (personal or contracted)?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>freelance</category>
      <category>developer</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Why do some Programming Tutorials not place emphasis on Software Architecture Principles?</title>
      <dc:creator>Orim Dominic Adah</dc:creator>
      <pubDate>Tue, 04 Feb 2020 07:29:55 +0000</pubDate>
      <link>https://dev.to/orimdominic/why-do-some-programming-tutorials-not-place-emphasis-on-software-architecture-principles-53im</link>
      <guid>https://dev.to/orimdominic/why-do-some-programming-tutorials-not-place-emphasis-on-software-architecture-principles-53im</guid>
      <description>&lt;p&gt;Why do some programming tutorials not include software architecture principles such as SOLID and design (anti-)patterns in building the projects that accompany the tutorials?&lt;/p&gt;

&lt;p&gt;These principles are important as they support the lifespan of any software project. What's more? They are better learnt using examples and use cases (of which the project being built during the tutorial contains a plethora of).&lt;/p&gt;

&lt;p&gt;This #discuss begs the question&lt;/p&gt;

&lt;center&gt;&lt;h3&gt;Why do some programming tutorials not place emphasis on software architecture principles while building the project(s) being built during the tutorial?&lt;/h3&gt;&lt;/center&gt;



&lt;h4&gt;And do you think they should?&lt;br&gt;
&lt;/h4&gt;

</description>
      <category>devdiscuss</category>
      <category>tutorials</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Which tool/language documentation do you have a strong confidence in?</title>
      <dc:creator>Orim Dominic Adah</dc:creator>
      <pubDate>Mon, 27 Jan 2020 12:39:33 +0000</pubDate>
      <link>https://dev.to/orimdominic/which-tool-language-documentation-do-you-have-a-strong-confidence-in-49jf</link>
      <guid>https://dev.to/orimdominic/which-tool-language-documentation-do-you-have-a-strong-confidence-in-49jf</guid>
      <description>&lt;p&gt;While developing anything, we are often faced with challenges on achieving what we want. At this point, a lot of us immediately search and visit the first stackoverflow link related to the challenge 👩‍💻👨‍💻..&lt;/p&gt;

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

&lt;p&gt;is there a language or tool which whenever you have challenges building something with it, you will check its documentation first before stackoverflow and why? &lt;/p&gt;

</description>
      <category>documentation</category>
      <category>devdiscuss</category>
      <category>stackoverflow</category>
    </item>
    <item>
      <title>Predicting JavaScript Equality Comparisons Correctly</title>
      <dc:creator>Orim Dominic Adah</dc:creator>
      <pubDate>Tue, 21 Jan 2020 16:06:34 +0000</pubDate>
      <link>https://dev.to/orimdominic/a-straightforward-guide-to-predicting-javascript-equality-comparisons-correctly-2oj0</link>
      <guid>https://dev.to/orimdominic/a-straightforward-guide-to-predicting-javascript-equality-comparisons-correctly-2oj0</guid>
      <description>&lt;p&gt;Predicting the result of an equality check of two or more values in JavaScript has been a part of the language that trips many developers; but not anymore, as this article stops at nothing in providing you with a straightforward and understandable approach to it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This article does not include explanations for edge case comparisons such as &lt;code&gt;[] == ""&lt;/code&gt; and &lt;code&gt;[undefined] == [null]&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;center&gt;
&lt;img src="https://i.giphy.com/media/2vqd1nnQVhp8rneZVi/source.gif" width="700" height="394"&gt;
&lt;/center&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Determining if any set of values are equal in JavaScript is achieved using any one of these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;Abstract Equality Operator&lt;/strong&gt; (&lt;code&gt;==&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Strict Equality Operator&lt;/strong&gt; (&lt;code&gt;===&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Object.is&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The major difference between the strict equality operator and the abstract equality operator is NOT that the strict equality operator checks for the equality of the value types being compared and the abstract equality operator does not; but that &lt;strong&gt;the strict equality operator does not allow coercion before comparison, while the abstract equality operator allows coercion before comparison.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Irrespective of the operator used, the result of checking the equality of any set of values is either &lt;code&gt;true&lt;/code&gt; (if the values compared are equal) or &lt;code&gt;false&lt;/code&gt; (if the values compared are not equal).&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparison with the Abstract Equality Operator (&lt;code&gt;==&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;When comparing the equality of any set of values using &lt;code&gt;==&lt;/code&gt;,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;There are seven value types here: &lt;code&gt;undefined&lt;/code&gt;, &lt;code&gt;null&lt;/code&gt;, &lt;code&gt;Boolean&lt;/code&gt;, &lt;code&gt;Number&lt;/code&gt;, &lt;code&gt;String&lt;/code&gt;, &lt;code&gt;Object&lt;/code&gt; and &lt;code&gt;Symbol&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;if the value types of any of the set of values to be compared are the same, there is no need for coercion; hence, a strict equality comparison is performed and the result is returned, otherwise;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;undefined&lt;/code&gt; and &lt;code&gt;null&lt;/code&gt; values are coercively equal to each other; in other words, testing if &lt;code&gt;undefined == null&lt;/code&gt; will return &lt;code&gt;true&lt;/code&gt;. &lt;code&gt;undefined&lt;/code&gt; and &lt;code&gt;null&lt;/code&gt; will not coerce to any other type (&lt;code&gt;Boolean&lt;/code&gt;, &lt;code&gt;Number&lt;/code&gt;, &lt;code&gt;String&lt;/code&gt;, &lt;code&gt;Object&lt;/code&gt;, or &lt;code&gt;Symbol&lt;/code&gt;) when &lt;code&gt;==&lt;/code&gt; is used to compare their equality with these other types;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;all &lt;code&gt;String&lt;/code&gt; and &lt;code&gt;Boolean&lt;/code&gt; values are first coerced to &lt;code&gt;Number&lt;/code&gt; values before a check for the equality of the values is determined. (The &lt;code&gt;Boolean false&lt;/code&gt; is coerced to &lt;code&gt;+0&lt;/code&gt;, while &lt;code&gt;true&lt;/code&gt; is coerced to &lt;code&gt;+1&lt;/code&gt;.);&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;all &lt;code&gt;object&lt;/code&gt;s (remember that &lt;code&gt;null&lt;/code&gt; is not an &lt;code&gt;object&lt;/code&gt; in this case) are coerced to their primitive values before an equality check is carried out.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The primitive value of an object is determined internally by the JavaScript engine, however, depending on the object hint, the object is either coerced to a &lt;code&gt;String&lt;/code&gt; (in the case of arrays) or to a &lt;code&gt;Number&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparison with the Strict Equality Operator (&lt;code&gt;===&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;When comparing the equality of any set of values using &lt;code&gt;===&lt;/code&gt;,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;if the value types (&lt;code&gt;Number&lt;/code&gt;, &lt;code&gt;String&lt;/code&gt; e.t.c) of the set of values under comparison are different, the JavaScript engine avoids coercion immediately and returns &lt;code&gt;false&lt;/code&gt;; otherwise,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;if the set of values under comparison are of type &lt;code&gt;String&lt;/code&gt; and they are exactly the same sequence of code units (same length and same code units at corresponding indices), the JavaScript engine returns &lt;code&gt;true&lt;/code&gt;; otherwise, it returns &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;if the set of values under comparison are of the &lt;code&gt;Boolean&lt;/code&gt; type, the JavaScript engine returns &lt;code&gt;true&lt;/code&gt; if the values are the same, otherwise it returns &lt;code&gt;false&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;if the set of values under comparison are of the type &lt;code&gt;Symbol&lt;/code&gt; and they have the same &lt;code&gt;Symbol&lt;/code&gt; value, the JavaScript engine returns &lt;code&gt;true&lt;/code&gt;, otherwise, it returns &lt;code&gt;false&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;if the set of values under comparison are of the &lt;code&gt;Object&lt;/code&gt; type and they reference the same object in memory, the JavaScript engine returns &lt;code&gt;true&lt;/code&gt;, otherwise, it returns &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;if any of the values under comparison is &lt;code&gt;NaN&lt;/code&gt;, the JavaScript engine returns &lt;code&gt;false&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;+0 and -0 Number values are equal to each other, therefore, return &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;center&gt;
&lt;img src="https://i.giphy.com/media/10QoHS5CjW50Ri/source.gif" width="500" height="281"&gt;
&lt;/center&gt;

&lt;h2&gt;
  
  
  Practice Time!
&lt;/h2&gt;

&lt;p&gt;What will be the result of the following comparisons?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;0 == null&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;false == undefined&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;true == 1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;'JavaScript' == true&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;'JavaScript' == false&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Answers
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;false&lt;/code&gt;. &lt;code&gt;null&lt;/code&gt; will not coerce to any other value except &lt;code&gt;undefined&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;false&lt;/code&gt;. &lt;code&gt;false&lt;/code&gt; gets coerced to its Number value (+0), but &lt;code&gt;undefined&lt;/code&gt; does not get coerced to its Number value (which is NaN). Since +0 is not the same as &lt;code&gt;undefined&lt;/code&gt;, false is returned.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can answer the rest in the comments section, with an explanation for your answer, and also feel free to add your own questions too 😉.&lt;/p&gt;

&lt;center&gt;&lt;h3&gt;Cheers 🥂&lt;/h3&gt;&lt;/center&gt;

</description>
      <category>javascript</category>
      <category>coercion</category>
      <category>equality</category>
      <category>operator</category>
    </item>
    <item>
      <title>Formatting Numbers in JavaScript with Intl.NumberFormat</title>
      <dc:creator>Orim Dominic Adah</dc:creator>
      <pubDate>Mon, 13 Jan 2020 20:34:45 +0000</pubDate>
      <link>https://dev.to/orimdominic/formatting-numbers-in-javascript-with-intl-numberformat-5goo</link>
      <guid>https://dev.to/orimdominic/formatting-numbers-in-javascript-with-intl-numberformat-5goo</guid>
      <description>&lt;center&gt;&lt;img src="https://i.giphy.com/media/1yMcQTLvuB1Evg4buK/source.gif" width="230" height="230"&gt;&lt;/center&gt;

&lt;p&gt;According to the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat" rel="noopener noreferrer"&gt;documentation on MDN&lt;/a&gt;,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;Intl.NumberFormat&lt;/code&gt; object is a constructor for objects that enable language-sensitive number formatting&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And this means what in practice?&lt;/p&gt;

&lt;p&gt;It simply means that with &lt;code&gt;Intl.NumberFormat&lt;/code&gt;, JavaScript can construct an object that will have the ability to style (or to be technically correct, format) numbers based on human languages. In other words, numbers can be styled in a more human-understandable format.&lt;/p&gt;

&lt;p&gt;Instead of numbers being presented as bland as &lt;code&gt;1234&lt;/code&gt; or &lt;code&gt;4561254&lt;/code&gt;, numbers can be better presented as &lt;code&gt;1,234&lt;/code&gt; or &lt;code&gt;$4,561.254&lt;/code&gt;. You get the gist? Good!&lt;/p&gt;

&lt;p&gt;How does this work? Well, the syntax is simple.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const formatterObject = new Intl.NumberFormat([locales[, options]]);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;What the syntax above means is this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;formatterObject&lt;/code&gt; is the object constructed (created) by &lt;code&gt;Intl.NumberFormat&lt;/code&gt;. &lt;code&gt;formatterObject&lt;/code&gt; holds methods that can be used to format numbers,&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;locales&lt;/code&gt; represents the code for human language that we want to format the number in. And why is this important?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Different languages have different ways of displaying numbers. A number like &lt;code&gt;123456&lt;/code&gt; will be displayed in Spanish as &lt;code&gt;123.456&lt;/code&gt;, in English as &lt;code&gt;123,456&lt;/code&gt; and in the Indian numerical system as &lt;code&gt;1,23,456&lt;/code&gt;. &lt;code&gt;locales&lt;/code&gt;is a code in the form of a string that informs &lt;code&gt;formatterObject&lt;/code&gt; of which language to use when formatting.&lt;/p&gt;

&lt;p&gt;You can find a list of the locales under &lt;code&gt;subtag&lt;/code&gt;&lt;br&gt;
  &lt;a href="http://www.iana.org/assignments/language-subtag-registry" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Examples are &lt;code&gt;'hi'&lt;/code&gt; for Hindi, &lt;code&gt;'de-AT'&lt;/code&gt; for German (de) used in Austria (AT) and &lt;code&gt;'en-IN'&lt;/code&gt; for English (en) used in India (IN). Number system codes such as &lt;code&gt;"arab"&lt;/code&gt;, &lt;code&gt;"arabext"&lt;/code&gt; and &lt;code&gt;"latn"&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;options&lt;/code&gt; refers to additional configurations that can be used to configure how &lt;code&gt;formatterObject&lt;/code&gt; styles numbers. &lt;code&gt;options&lt;/code&gt; is an object.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't be dismayed by the square braces &lt;code&gt;[]&lt;/code&gt; in the syntax. They are simply saying &lt;em&gt;Hey developer! Whatever is within me is optional. You can decide to exclude them when writing the syntax and the default configurations will be used&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Using the number &lt;code&gt;1234567890.1234&lt;/code&gt; as an example, lets convert our knowledge into code.&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1234567890.1234&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// setup formatters&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hindiNumberFormatter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Intl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NumberFormat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en-IN&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;britishNumberFormatter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Intl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NumberFormat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en-GB&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;spanishNumberFormatter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Intl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NumberFormat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;es-ES&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// use formatters&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hindiNumberFormatter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// 1,23,45,67,890.123&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;britishNumberFormatter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// 1,234,567,890.123&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;spanishNumberFormatter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// 1.234.567.890,123&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What happened?&lt;/p&gt;

&lt;p&gt;We created three types of number formatters with Intl.NumberFormat: &lt;code&gt;hindiNumberFormatter&lt;/code&gt;, &lt;code&gt;britishNumberFormatter&lt;/code&gt; and &lt;code&gt;spanishNumberFormatter&lt;/code&gt;. Each formatter was created with a locale configuration that sets the formatting language of the formatter.&lt;/p&gt;

&lt;p&gt;Next, we use the &lt;code&gt;format&lt;/code&gt; method on the formatters to style the number &lt;code&gt;num&lt;/code&gt; and display the result on the console.&lt;/p&gt;

&lt;p&gt;And why is the last &lt;code&gt;4&lt;/code&gt; not displayed in the formatted result? Did you notice that? Okay. Lets try another example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1234567890.1234&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;formatConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;currency&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;USD&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// CNY for Chinese Yen, EUR for Euro&lt;/span&gt;
  &lt;span class="na"&gt;minimumFractionDigits&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="na"&gt;currencyDisplay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;symbol&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;// setup formatters&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;britishNumberFormatter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Intl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NumberFormat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en-GB&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;formatConfig&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;spanishNumberFormatter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Intl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NumberFormat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;es-ES&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;formatConfig&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// use formatters&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;britishNumberFormatter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// US$1,234,567,890.12&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;spanishNumberFormatter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// 1.234.567.890,12 US$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;😃 Interesting! What happened here again?&lt;/p&gt;

&lt;p&gt;Remember the second parameter in the &lt;code&gt;Intl.NumberFormat&lt;/code&gt;? The &lt;code&gt;options&lt;/code&gt; object? It is used to setup additional configurations for how &lt;code&gt;formatterObject&lt;/code&gt; would format numbers passed to it. With properties such as &lt;code&gt;style&lt;/code&gt; (possible values are &lt;code&gt;"decimal"&lt;/code&gt; for plain number formatting, &lt;code&gt;"currency"&lt;/code&gt; for currency formatting, and &lt;code&gt;"percent"&lt;/code&gt; for percent formatting; the default is &lt;code&gt;"decimal"&lt;/code&gt;), &lt;code&gt;currency&lt;/code&gt;, &lt;code&gt;maximumSignificantDigits&lt;/code&gt; (values are integers that determine how many significant digits the number to be formatted should have), &lt;code&gt;minimumFractionDigits&lt;/code&gt; (having the value of an integer that determines the how many decimal digits the formatted number should have).&lt;/p&gt;

&lt;p&gt;As in the second example, did you notice that the last two decimal digits (3 and 4) are not in the formatted number? That's because the minimum number of decimal digits we set in the &lt;code&gt;options&lt;/code&gt; parameter as &lt;code&gt;formatConfig&lt;/code&gt;, (&lt;code&gt;minimumFractionDigits&lt;/code&gt;) was 2. See?&lt;/p&gt;

&lt;p&gt;Apart from the &lt;code&gt;format&lt;/code&gt; method on the &lt;code&gt;formatterObject&lt;/code&gt;, there is also another method, the &lt;code&gt;formatToParts&lt;/code&gt; method which returns an array of objects representing the number string in parts that can be used for custom locale-aware formatting.&lt;br&gt;
For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1234.5678&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;britishNumberFormatter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Intl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NumberFormat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en-GB&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;spanishNumberFormatter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Intl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NumberFormat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;es-ES&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;britishNumberFormatter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;formatToParts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="cm"&gt;/*
[
  0: Object { type: "integer", value: "1" }
  1: Object { type: "group", value: "," }
  2: Object { type: "integer", value: "234" }
  3: Object { type: "decimal", value: "." }
  4: Object { type: "fraction", value: "568" }
]
*/&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;spanishNumberFormatter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;formatToParts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// 1.234.567.890,123&lt;/span&gt;
&lt;span class="cm"&gt;/*
[
  0: Object { type: "integer", value: "1234" }
  1: Object { type: "decimal", value: "," }
  2: Object { type: "fraction", value: "568" }
] */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;formatToParts&lt;/code&gt; splits the formatted number into parts, and determines the digit type (integer or fraction) and the symbol type (group or decimal).&lt;/p&gt;

&lt;p&gt;Other configuration options for &lt;code&gt;options&lt;/code&gt; can be found in the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat" rel="noopener noreferrer"&gt;MDN documentation for &lt;code&gt;Intl.NumberFormat&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Experimental Features with Intl.NumberFormat
&lt;/h3&gt;

&lt;p&gt;Some interesting features are being added to &lt;code&gt;Intl.NumberFormat&lt;/code&gt; such as the ability to format with units (&lt;code&gt;l, mi/h, mph&lt;/code&gt;), using exponential notations (E&lt;sup&gt;8&lt;/sup&gt;, E&lt;sup&gt;-2&lt;/sup&gt;) and BigInt support. These features cannot be used in production code yet. At the moment, only Chrome 77+ provides support for these features.&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1235.12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;formatConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;units&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;unit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;meter-per-second&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;// setup formatters&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;britishNumberFormatter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Intl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NumberFormat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;formatConfig&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 1,235.12 m/s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's a pity but at the time of this writing, &lt;code&gt;Intl.NumberFormat&lt;/code&gt; does not exist in Node.js.&lt;/p&gt;

&lt;p&gt;All the best of all the best as you use &lt;code&gt;Intl.NumberFormat&lt;/code&gt; to display numbers in styles customised for human languages and human-readable formats.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>number</category>
      <category>languages</category>
    </item>
    <item>
      <title>Darting into Flutter - My Experience</title>
      <dc:creator>Orim Dominic Adah</dc:creator>
      <pubDate>Mon, 06 Jan 2020 03:25:29 +0000</pubDate>
      <link>https://dev.to/orimdominic/darting-into-flutter-my-experience-415o</link>
      <guid>https://dev.to/orimdominic/darting-into-flutter-my-experience-415o</guid>
      <description>&lt;p&gt;Around the fourth quarter of 2019, my boss informs me about his plans to develop an e-commerce application for the clients of one of his companies. He asks me about what web application technologies I know of that can satisfy the requirements of the application, and after personal research, I presented my list of available options to him; subtly marketing React Native to him. This was because according to my findings, there were more developers in the community using it than the other options. It had to be the best, right? &lt;em&gt;Popularity-driven development!&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;One other reason I hadn't been sold the Flutter 'wave' was because I had to learn Dart (yet another language! 😭). I had learnt Java for developing android applications some years earlier and TypeScript when we had to develop Angular applications. Not another language again please! Please!&lt;/p&gt;

&lt;p&gt;He summons me up some days later to tell me about Flutter and asks me about what I knew about it. I remind him that I had briefed him about it earlier, and how it does about the same thing as React Native (still marketing React Native to him, subtly). My boss tells me he thinks that Flutter is great for the next set of applications that he wants us to build (🙄 why won't an ardent fan of Google technologies think so? 😕)&lt;/p&gt;

&lt;p&gt;My boss, being the awesome marketer that he habitually is, doesn't give me an opportunity to object at all. He quickly shows me sample applications built using Flutter. That was the first thing that got me hooked! &lt;/p&gt;

&lt;p&gt;He makes me learn it with him, watching videos from the amazing &lt;a href="https://twitter.com/yu_angela" rel="noopener noreferrer"&gt;Angela Yu&lt;/a&gt; of London App Brewery, who taught it in an energetic fashion. Second hook! &lt;/p&gt;

&lt;p&gt;One framework for Web, Android, iOS and in anxious expectation, Fuschia. What's not to be hooked about? Hook three!&lt;/p&gt;

&lt;p&gt;At this point, I had lost my skepticism over Flutter. I had become hooked! I was in, and it was as if the veil of bias over my perspective was lifted.&lt;/p&gt;

&lt;p&gt;The last thing that got me hooked was the Dart programming language. Understanding it was easy because of my previous experience with Java and JavaScript. Dart seemed like a middle ground between both languages to me; without the perks of JavaScript and the relative complexities of Java. My boss kept affectionately calling Dart &lt;em&gt;the best of both worlds&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Although I was pretty disappointed when I found out that Flutter for the web platform was still undergoing technical review and could not be used in production at the time, I was delighted that when it eventually becomes stable, I'll be one of the first to test it out. Hmm. The countless things a bias perspective can make you accept! 😉&lt;/p&gt;

&lt;p&gt;I checked the Flutter community on Twitter, and was impressed with the timely updates and support I saw. Don't ask me! I've already added the 💙 emoji to my name on Twitter and have started following &lt;a href="https://twitter.com/FlutterDev" rel="noopener noreferrer"&gt;@FlutterDev&lt;/a&gt;, &lt;a href="https://twitter.com/MartinAguinis" rel="noopener noreferrer"&gt;@MartinAguinis&lt;/a&gt;, &lt;a href="https://twitter.com/filiphracek" rel="noopener noreferrer"&gt;@filiphracek&lt;/a&gt;, &lt;a href="https://twitter.com/remi_rousselet" rel="noopener noreferrer"&gt;@remi_rousselet&lt;/a&gt; and &lt;a href="https://twitter.com/devangelslondon" rel="noopener noreferrer"&gt;Simon Lightfoot&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope to learn, make the best use of, have fun with and contribute to this awesome framework - Flutter - in the coming days.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>beginners</category>
      <category>experience</category>
    </item>
    <item>
      <title>Handling animations properly with the RxJS finalize operator</title>
      <dc:creator>Orim Dominic Adah</dc:creator>
      <pubDate>Tue, 23 Jul 2019 06:57:52 +0000</pubDate>
      <link>https://dev.to/rxjs/handling-animations-properly-with-the-rxjs-finalize-operator-f9</link>
      <guid>https://dev.to/rxjs/handling-animations-properly-with-the-rxjs-finalize-operator-f9</guid>
      <description>&lt;p&gt;I was building an Angular application recently which had to request for data from an API. Since I was using the Angular HttpClient, the response for the data request was wrapped in an observable by default.&lt;/p&gt;

&lt;p&gt;Whenever a &lt;code&gt;GET&lt;/code&gt; request for data was initiated, I wanted an animated ellipses to be displayed, indicating that the data retrieval process was ongoing. If the data was successfully retrieved, or an error occured during the retrieval process, the animated ellipses should exit the screen.&lt;/p&gt;

&lt;p&gt;An observable is a data type that continually emits data to a subscriber that is attached to it. A subscriber is a data type that continually listens for data emitted from an observable it is subscribed to. When a subscriber subscribes to an observable, the subscriber is provided with three handlers to respond to the data that the observable emits. These three handlers are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;next&lt;/code&gt; handler - executed when the observable source emits a new value from its data sequence,&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;error&lt;/code&gt; handler - executed when an error occurs in the emission of values from the observable's data sequence, and&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;complete&lt;/code&gt; handler - executed when there is no more value available to be emitted from the observable sequence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Assuming the &lt;code&gt;getResults&lt;/code&gt; method below returns an observable, the &lt;code&gt;next&lt;/code&gt;, &lt;code&gt;error&lt;/code&gt; and &lt;code&gt;complete&lt;/code&gt; handlers are exemplified in its subscribe method as shown in the code snippet below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;getResults&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Next handler executed with results: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error handler executed with error: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Complete handler executed. All values have been emitted`&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Being a newbie to observables, I placed the method that hid the animated ellipses in the &lt;code&gt;complete&lt;/code&gt; method as demonstrated in the snippet below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;getResults&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;displayResults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;notifyOnError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;hideAnimatedEllipses&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and the animated ellipses was hidden (as long as the request returned no errors). Whenever there was an error, the animated ellipses still danced around the user interface alongside the error message displayed.&lt;/p&gt;

&lt;p&gt;In order to solve this, the first thing I did was to execute the &lt;code&gt;hideAnimatedEllipses()&lt;/code&gt; method in the &lt;code&gt;complete&lt;/code&gt; and &lt;code&gt;error&lt;/code&gt; handlers. Sure thing! It worked, but then I got to know about the finalize operator, a better way to get the job done.&lt;/p&gt;

&lt;p&gt;Learning about the finalize operator not only solved my problem, it also exposed the fault in my understanding of the three subscription handlers.&lt;/p&gt;

&lt;p&gt;I got to find out that after the &lt;code&gt;error&lt;/code&gt; handler is executed, further calls to the &lt;code&gt;next&lt;/code&gt; handler will have no effect, and that after the &lt;code&gt;complete&lt;/code&gt; handler is executed, further calls to &lt;code&gt;next&lt;/code&gt; handler will have no effect too. That was why the animated ellipses continued to confidently dance on the user interface in the first instance even after the error message was displayed.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;finalize&lt;/strong&gt;: The &lt;code&gt;finalize&lt;/code&gt; operator is executed when an observable's source terminates on complete or on error.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I realised that in the execution of the &lt;code&gt;finalize&lt;/code&gt; operator function is where the &lt;code&gt;hideAnimatedEllipses()&lt;/code&gt; function should properly reside, and so the code was updated to the code snippet shown below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;getResults&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;finalize&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;hideAnimatedEllipses&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;displayResults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;notifyOnError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In essense&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;strong&gt;&lt;code&gt;next&lt;/code&gt;&lt;/strong&gt; handler is executed when the observable source emits a new value from its data sequence,&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;&lt;code&gt;error&lt;/code&gt;&lt;/strong&gt; handler is executed when an error occurs in the emission of values from the observable's data sequence. After it is executed, further calls to &lt;code&gt;next&lt;/code&gt; will have no effect, and&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;&lt;code&gt;complete&lt;/code&gt;&lt;/strong&gt; handler is executed when there is no more value available to be emitted from the observable sequence. After it is executed, further calls to &lt;code&gt;next&lt;/code&gt; will have no effect&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;&lt;code&gt;finalize&lt;/code&gt;&lt;/strong&gt; operator is executed when an observable's source terminates on complete or on error.The code in the &lt;code&gt;finalize&lt;/code&gt; operator is also executed when a subscriber unsubscribes from an observable, thus &lt;code&gt;finalize&lt;/code&gt; acts like the &lt;code&gt;finally&lt;/code&gt; method of a promise or a &lt;code&gt;try-catch-finally&lt;/code&gt; block. Before RxJS v5.5, it was denoted as &lt;code&gt;finally&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can find more information about the &lt;code&gt;finalize&lt;/code&gt; operator in the RxJS docs &lt;a href="http://reactivex.io/rxjs/file/es6/operators/finalize.js.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cheers!😃&lt;/p&gt;

</description>
      <category>rxjs</category>
      <category>javascript</category>
      <category>typescript</category>
      <category>finalize</category>
    </item>
    <item>
      <title>Using toLocaleString for number objects in JavaScript</title>
      <dc:creator>Orim Dominic Adah</dc:creator>
      <pubDate>Mon, 15 Jul 2019 03:28:02 +0000</pubDate>
      <link>https://dev.to/orimdominic/using-tolocalestring-for-number-objects-in-javascript-1bfh</link>
      <guid>https://dev.to/orimdominic/using-tolocalestring-for-number-objects-in-javascript-1bfh</guid>
      <description>&lt;p&gt;The &lt;code&gt;toLocaleString&lt;/code&gt; method in JavaScript is present on the array, date, number object and object data types. This article focuses on the &lt;code&gt;toLocaleString&lt;/code&gt; method on JavaScript number objects. Note that &lt;code&gt;toLocaleString&lt;/code&gt; doesn't exist in Node.js as at the time of this writing.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;toLocaleString&lt;/code&gt; method, when called on a JavaScript number object (not a number literal like 234 or 3, but an identifier - a variable or a constant - with a number value), formats the number based on the values passed into it and returns a string representation of the formatted value. Well, so why not use &lt;code&gt;toString&lt;/code&gt; if that's all the &lt;code&gt;toLocaleString&lt;/code&gt; method does? Good question!&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;toLocaleString&lt;/code&gt; method takes in arguments that tell it what human language to format the number object into. In other words, while the Britons will write 'five hundred thousand' as &lt;code&gt;500,000&lt;/code&gt;, the Spaniards will write it as &lt;code&gt;500.000&lt;/code&gt;. The &lt;code&gt;toLocaleString&lt;/code&gt; will take the number &lt;code&gt;500000&lt;/code&gt; and if you ask it to format it for the Britons, it will return &lt;code&gt;'500,000'&lt;/code&gt;. If asked to format it for the Spaniards, it will return &lt;code&gt;'500.000'&lt;/code&gt;. Everyone will understand the number in their native language. Talk about babel, but for JavaScript numbers to humans. It has support for Arabic too. Now, isn't that awesome?&lt;/p&gt;

&lt;p&gt;Okay, talk is cheap. Show me the code.&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;500000&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;britishNum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en-GB&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//en-GB: Great Britain English&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;numeroEsp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;es-ES&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//es-ES: Spanish Spanish&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;arabicNum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ar-EG&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//ar-EG: Eastern Arabic&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;British representation: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;britishNum&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 500,000&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Spanish representation: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;numeroEsp&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 500.000&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Arabic representation: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;arabicNum&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// ٥٠٠٬٠٠٠&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Awesome init? Now here's some explanation, and some more &lt;code&gt;toLocaleString&lt;/code&gt; awesomeness.&lt;/p&gt;

&lt;p&gt;The format or syntax for the implementation of &lt;code&gt;toLocaleString&lt;/code&gt; is like this: &lt;code&gt;numObj.toLocaleString([locales [, options]])&lt;/code&gt;, where&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;numObj&lt;/code&gt; is the number object to be formatted,&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;locales&lt;/code&gt; represents a string (like &lt;code&gt;es-ES&lt;/code&gt; or &lt;code&gt;ar-EG&lt;/code&gt;) which is the language to be formatted into, (See &lt;a href="https://stackoverflow.com/questions/3191664/list-of-all-locales-and-their-short-codes" rel="noopener noreferrer"&gt;this stackoverflow question&lt;/a&gt; for a list of &lt;code&gt;locales&lt;/code&gt; codes.)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;options&lt;/code&gt; is an object, with properties that contain some really extra-awesome formatting options, like formatting for currency, how many decimal places do you want ish.
The square braces &lt;code&gt;[]&lt;/code&gt; only mean that &lt;code&gt;locales&lt;/code&gt; and &lt;code&gt;options&lt;/code&gt; are optional. In other words, one can use the &lt;code&gt;toLocaleString&lt;/code&gt; method without passing them in.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;😲 So what language will it be formatted into if one doesn't pass in any parameters? To the default language of your browser of course!.&lt;/p&gt;

&lt;p&gt;Now to the &lt;strong&gt;really extra-awesomeness&lt;/strong&gt; part. Talk is cheap you say? Show me the code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Currency formatting
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;500000&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;britishCurrency&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en-GB&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="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;currency&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GBP&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;japaneseCurrency&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ja-JP&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="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;currency&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;JPY&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;British currency: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;britishCurrency&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// £500,000.00&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Japanese currency: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;japaneseCurrency&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// ￥500,000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Number of decimal places
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;500000.5525&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;british&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en-GB&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="na"&gt;maximumFractionDigits&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="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;spanish&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;es-ES&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="na"&gt;maximumFractionDigits&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="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;British: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;british&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 500,000.553&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Spanish: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;spanish&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 500.000,55&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code shown. Now to the explanation, shall we?&lt;/p&gt;

&lt;p&gt;The object passed in after the &lt;code&gt;locales&lt;/code&gt; parameter contains properties which one can customise as they please to get the number format that they want. &lt;code&gt;style&lt;/code&gt;&lt;br&gt;
&lt;code&gt;currency&lt;/code&gt; and&lt;br&gt;
&lt;code&gt;maximumFractionDigits&lt;/code&gt; are some of those properties. The object holding those properties is the &lt;code&gt;options&lt;/code&gt; parameter in the syntax above.&lt;/p&gt;

&lt;p&gt;You can view the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#Using_options" rel="noopener noreferrer"&gt;MDN Docs on using the &lt;code&gt;options&lt;/code&gt; object&lt;/a&gt; to customize your &lt;code&gt;toLocaleString&lt;/code&gt; output.&lt;/p&gt;

&lt;p&gt;Good luck using &lt;code&gt;toLocaleString&lt;/code&gt; with number objects!&lt;/p&gt;

&lt;p&gt;Cover image by &lt;a href="https://www.sitepen.com/" rel="noopener noreferrer"&gt;sitepen&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tolocalestring</category>
      <category>number</category>
      <category>languages</category>
    </item>
  </channel>
</rss>
