<?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: aronsantha</title>
    <description>The latest articles on DEV Community by aronsantha (@aronsantha).</description>
    <link>https://dev.to/aronsantha</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%2F1134831%2F332e7b5b-eb57-4feb-8f3e-1b74bf11a685.png</url>
      <title>DEV Community: aronsantha</title>
      <link>https://dev.to/aronsantha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aronsantha"/>
    <language>en</language>
    <item>
      <title>&gt; Dynamic SVG in Vue with Vite</title>
      <dc:creator>aronsantha</dc:creator>
      <pubDate>Thu, 06 Jun 2024 20:06:31 +0000</pubDate>
      <link>https://dev.to/aronsantha/-dynamic-svg-in-vue-with-vite-40jl</link>
      <guid>https://dev.to/aronsantha/-dynamic-svg-in-vue-with-vite-40jl</guid>
      <description>&lt;p&gt;Let me show you a super useful implementation of Vite's &lt;a href="https://vitejs.dev/guide/features#glob-import" rel="noopener noreferrer"&gt;Glob Imports&lt;/a&gt;: creating a wrapper component for displaying SVGs.&lt;/p&gt;




&lt;p&gt;This Vue 3 component below imports all files that&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;are located in &lt;code&gt;/src/assets/svg&lt;/code&gt; folder, and&lt;/li&gt;
&lt;li&gt;have &lt;code&gt;.svg&lt;/code&gt; extension
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// BaseSvg.vue

&amp;lt;template&amp;gt;
  &amp;lt;div v-html="svg" v-if="svg"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script lang="ts" setup&amp;gt;
import { computed } from "vue";

const props = defineProps&amp;lt;{
  name: string;
}&amp;gt;();

const modules = import.meta.glob("/src/assets/svg/*.svg", {
  query: "?raw",
  import: "default",
  eager: true,
});

const svg = computed(() =&amp;gt; {
  return modules["/src/assets/svg/" + (props.name ?? "") + ".svg"] ?? null;
});
&amp;lt;/script&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;Here's what we need to do when we add a new SVG to the project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Drop the file in the /svg folder&lt;/li&gt;
&lt;li&gt;Import the BaseSvg component and use it in the template&lt;/li&gt;
&lt;li&gt;Pass the filename we want to display, as the &lt;code&gt;name&lt;/code&gt; prop.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// script
import BaseSvg from "@/components/BaseSvg.vue";

// template
&amp;lt;BaseSvg name="heart-icon" class="w-12 text-slate-500" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;💡&lt;strong&gt;TIP&lt;/strong&gt;: Set each svg file's &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt; to "100%", and &lt;code&gt;fill&lt;/code&gt; (or &lt;code&gt;stroke&lt;/code&gt;) to "currentColor". This will help with adding styles to the component. Eg.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// heart-icon.svg

&amp;lt;svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"&amp;gt;
&amp;lt;path d="M2 9.1371C2 14 6.01943 16.5914 8.96173 18.9109C10 19.7294 11 20.5 12 20.5C13 20.5 14 19.7294 15.0383 18.9109C17.9806 16.5914 22 14 22 9.1371C22 4.27416 16.4998 0.825464 12 5.50063C7.50016 0.825464 2 4.27416 2 9.1371Z" fill="currentColor"/&amp;gt;
&amp;lt;/svg&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;So, there you have it. This wrapper component comes really handy in projects that use many custom icons. It helps DRYing up the code and keeping maintenance at a minimum.&lt;/p&gt;

&lt;p&gt;Good luck, and have fun using it!&lt;/p&gt;

</description>
      <category>codecapsule</category>
      <category>vite</category>
      <category>vue</category>
    </item>
    <item>
      <title>&gt; Digital Accessibility 2: HOW</title>
      <dc:creator>aronsantha</dc:creator>
      <pubDate>Fri, 20 Oct 2023 15:31:49 +0000</pubDate>
      <link>https://dev.to/aronsantha/-digital-accessibility-2-how-8e</link>
      <guid>https://dev.to/aronsantha/-digital-accessibility-2-how-8e</guid>
      <description>&lt;p&gt;Digital accessibility (abbreviated as a11y) is about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;designing and building digital products...&lt;/li&gt;
&lt;li&gt;so that they can be used in a meaningful and equal way...&lt;/li&gt;
&lt;li&gt;by as many people as possible — including those with disabilities.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  HOW: How can you measure and improve it?
&lt;/h2&gt;

&lt;p&gt;Using accessibility standards, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;local and international laws, policies and industry standards&lt;/li&gt;
&lt;li&gt;Web Content Accessibility Guidelines (&lt;a href="https://www.w3.org/WAI/standards-guidelines/wcag/" rel="noopener noreferrer"&gt;link&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Web Content Accessibility Guidelines (WCAG)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Facts:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Gold standard for digital accessibility.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Created for&lt;/strong&gt;: app designers and developers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Created by&lt;/strong&gt;: the creators of the World Wide Web, in association with international organizations and governments.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Three levels (&lt;a href="https://ialabs.ie/what-is-the-difference-between-wcag-a-aa-and-aaa/" rel="noopener noreferrer"&gt;read more&lt;/a&gt;):
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Level A&lt;/strong&gt;: Basic (30 rules)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Level AA&lt;/strong&gt;: Strong (Level A + 20 rules)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Level AAA&lt;/strong&gt;: Excellent (Level AA + 28 rules)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  POUR Principles:
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Facts:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;First step towards accessibility&lt;/strong&gt;, based on WCAG.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human centric&lt;/strong&gt;: Instead of hard-and-fast rules, it helps you understand the diverse needs of your users (including people with disabilities), and facilitating those needs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Four aspects&lt;/strong&gt;: Perceivable, Operable, Understandable, and Robust.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  1. Perceivable 👀
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Consider&lt;/strong&gt;: &lt;br&gt;
Can all users perceive all essential information on the screen?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tips&lt;/strong&gt;: &lt;br&gt;
Some ways to make your product more perceivable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Offer alternative ways to access information. 

&lt;ul&gt;
&lt;li&gt;text content: screen-reader friendly (mark-up for headings, lists, tables etc), translations, simplified language.&lt;/li&gt;
&lt;li&gt;non-text content (images, videos, charts): descriptions, captions, transcripts.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Make content easier to see and hear. 

&lt;ul&gt;
&lt;li&gt;provide sufficient contrast between the background and foreground elements (text, graphics, buttons etc)&lt;/li&gt;
&lt;li&gt;ensure color is not the only method of conveying meaning.&lt;/li&gt;
&lt;li&gt;ensure users can pause, stop, and adjust the volume of audio and video content.&lt;/li&gt;
&lt;li&gt;ensure no information is lost when users resize text up to 400%&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Operable 🖱️
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Consider&lt;/strong&gt;:&lt;br&gt;
Can all users interact with all interactive elements of your product?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tips&lt;/strong&gt;:&lt;br&gt;
Some ways to make your product more operable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure that all functionality that is available by mouse is also available by keyboard and touch-screen (click, scroll, navigate)&lt;/li&gt;
&lt;li&gt;Provide necessary controls for page-navigation (Go back, breadcrumb), slideshows and videos.&lt;/li&gt;
&lt;li&gt;Give users enough time to fill out a form or a method to extend the time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Understandable 🧠
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Consider&lt;/strong&gt;:&lt;br&gt;
Can all users understand the operation of the UI and the information presented on it?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tips&lt;/strong&gt;:&lt;br&gt;
Some ways to make your product more understandable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Write clear and simply:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;avoid complex words wherever possible, and provide interpretation for any unusual words, abbreviations, symbols.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Ensure predictability and consistency:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;provide predictable navigation mechanisms&lt;/li&gt;
&lt;li&gt;make sure repeated components look and behave the same way&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Ensure error messages are clear and easy to resolve.&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Robust 🔌
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Consider&lt;/strong&gt;:&lt;br&gt;
Is your app compatible with different devices, browsers, assistive technologies, and other user agents?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tips&lt;/strong&gt;:&lt;br&gt;
Some ways to make your product more compatible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure content is consistently accessible:

&lt;ul&gt;
&lt;li&gt;with different screen reader technologies&lt;/li&gt;
&lt;li&gt;regardless of screen size and orientation&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This post is part of a series on digital accessibility. The content of this series is based on various resources, including the &lt;a href="https://web.dev/learn/accessibility" rel="noopener noreferrer"&gt;Learn Accessibility course&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>wcag</category>
      <category>learningarchives</category>
    </item>
    <item>
      <title>&gt; Digital Accessibility 1: WHY and WHO</title>
      <dc:creator>aronsantha</dc:creator>
      <pubDate>Fri, 20 Oct 2023 14:51:11 +0000</pubDate>
      <link>https://dev.to/aronsantha/-digital-accessibility-1-why-and-who-2m17</link>
      <guid>https://dev.to/aronsantha/-digital-accessibility-1-why-and-who-2m17</guid>
      <description>&lt;p&gt;Digital accessibility (abbreviated as a11y) is about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;designing and building digital products...&lt;/li&gt;
&lt;li&gt;so that they can be used in a meaningful and equal way...&lt;/li&gt;
&lt;li&gt;by as many people as possible — including those with disabilities.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  WHY: Why focus on it?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Over 15% of the world's population self-identify as having a disability. By catering to them, you &lt;strong&gt;broaden your audience&lt;/strong&gt;. (You also avoid getting a bad reputation and facing discrimination lawsuits).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When you design for accessibility, you also &lt;strong&gt;enhance the user experience for everyone else&lt;/strong&gt;. (This is called the &lt;a href="https://sketchplanations.com/the-curb-cut-effect" rel="noopener noreferrer"&gt;curb-cut effect&lt;/a&gt;). &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me do the math for you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;larger audience + happier users = increased revenue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  WHO: Main groups to consider
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Visual impairments 👁️
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Examples&lt;/strong&gt;: blindness, low vision, color blindness&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prevalence&lt;/strong&gt; (worldwide): 13% vision loss, 3% color blind&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pain points&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;digital products that do not work with screen reader software&lt;/li&gt;
&lt;li&gt;mobile websites/apps without pinch to zoom, complex graphs and charts differentiated by colors alone&lt;/li&gt;
&lt;li&gt;color contrasts that make it difficult to read text on the screen&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  2. Mobility impairments ♿️
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Examples&lt;/strong&gt;: arthritis, paralysis, amputees, seizure disorders&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prevalence&lt;/strong&gt; (worldwide): 1 in 7 people &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pain points&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;elements that are only designed to work with the use of a mouse.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. Hearing impairments 👂🏼
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Examples&lt;/strong&gt;: deafness, heard of hearing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prevalence&lt;/strong&gt; (worldwide): 20%&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pain points&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;audio content without text transcripts&lt;/li&gt;
&lt;li&gt;video content without well-synchronized captions&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  4. Cognitive impairments 🧠
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Examples&lt;/strong&gt;: Down's syndrome, autism, ADHD, dyslexia, aphasia&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pain points&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;busy interfaces that make it overly complicated to focus on the task at hand,&lt;/li&gt;
&lt;li&gt;large blocks of (justified) text with minimal whitespace&lt;/li&gt;
&lt;li&gt;small or hard-to-read fonts&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  +1. Others who can benefit from improved accessibility
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Temporarily disabled&lt;/strong&gt;: a person with a broken leg, or with slower thinking due to medication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Situationally disabled&lt;/strong&gt;: a person experiencing glare on a device screen or someone watching a video without sound on the train.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mildly disabled&lt;/strong&gt;. A person needing eyeglasses to see a screen or captions to understand audio.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Older people&lt;/strong&gt; with age-related diminishing senses, eg. vision, grip, cognitive abilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Non-native speakers&lt;/strong&gt;: they can take longer time to understand content.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SEO bots&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This post is part of a series on digital accessibility. The content of this series is based on various resources, including the &lt;a href="https://web.dev/learn/accessibility" rel="noopener noreferrer"&gt;Learn Accessibility course&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>wcag</category>
      <category>learningarchives</category>
    </item>
    <item>
      <title>&gt; From flexbox 101 to flex-grow 9999</title>
      <dc:creator>aronsantha</dc:creator>
      <pubDate>Fri, 13 Oct 2023 09:27:24 +0000</pubDate>
      <link>https://dev.to/aronsantha/-from-flexbox-101-to-flex-grow-9999-32bh</link>
      <guid>https://dev.to/aronsantha/-from-flexbox-101-to-flex-grow-9999-32bh</guid>
      <description>&lt;p&gt;I love &lt;strong&gt;responsive design&lt;/strong&gt; - making sure my app can scale across all screen sizes. But here's the thing: I also want to &lt;strong&gt;avoid media queries&lt;/strong&gt; whenever possible. Why? Because &lt;strong&gt;breakpoint are too rigid&lt;/strong&gt;, too "hardcoded".&lt;/p&gt;




&lt;h3&gt;
  
  
  Flexbox 101
&lt;/h3&gt;

&lt;p&gt;So, the other day I had to place two DIVs &lt;strong&gt;next to each other&lt;/strong&gt; - if they fit. And if they don't, then &lt;strong&gt;stack them&lt;/strong&gt; on top of each other.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Easy: Apply &lt;code&gt;display: flex&lt;/code&gt; and &lt;code&gt;flex-wrap: wrap&lt;/code&gt; on their parent container.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Okay, now how to make sure they &lt;strong&gt;fill in the available room&lt;/strong&gt; both when they are inline, and also &lt;strong&gt;when they are stacked&lt;/strong&gt;?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Add &lt;code&gt;flex-grow: 1&lt;/code&gt; to both DIVs.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  The trick:
&lt;/h3&gt;

&lt;p&gt;So far, it's been Flexbox 101. But here comes the tricky part: I want DIV2 to &lt;strong&gt;expand as wide as it can&lt;/strong&gt;, and shrink DIV1 to its minimum. &lt;/p&gt;

&lt;p&gt;Removing &lt;code&gt;flex-grow&lt;/code&gt; from DIV1 would solve this issue when the DIVs are in a row, but it would prohibit DIV1 from growing when they are stacked. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So what do we do?&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Change &lt;code&gt;flex-grow: 1&lt;/code&gt; to &lt;code&gt;flex-grow: 9999&lt;/code&gt; on DIV2.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h4&gt;
  
  
  Now, the two DIVs behave as required:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;If they fit next to each other:
they fill up the container's width, with DIV2 getting priority to take as much room as possible, shrinking DIV1 to its minimum width.&lt;/li&gt;
&lt;li&gt;If they don't fit in a row:
the DIVs wrap under one another, and they each expand to the container's width.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>notetoself</category>
      <category>css</category>
    </item>
    <item>
      <title>&gt; Merging arrays (with and without duplicates)</title>
      <dc:creator>aronsantha</dc:creator>
      <pubDate>Fri, 29 Sep 2023 08:59:13 +0000</pubDate>
      <link>https://dev.to/aronsantha/-merging-arrays-with-and-without-duplicates-2ek5</link>
      <guid>https://dev.to/aronsantha/-merging-arrays-with-and-without-duplicates-2ek5</guid>
      <description>&lt;p&gt;Today, I ran into a situation where simply merging two arrays was not enough: the new array had to &lt;strong&gt;only include unique values&lt;/strong&gt;. Let's see how I tackled it.&lt;/p&gt;




&lt;h3&gt;
  
  
  Before: Using Spread Operator to Combine Arrays:
&lt;/h3&gt;

&lt;p&gt;To merge two arrays and include all elements from both, we can use the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax" rel="noopener noreferrer"&gt;Spread operator&lt;/a&gt; like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return [...arrayOne, ...arrayTwo];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  After: Using Set to Remove Duplicates:
&lt;/h3&gt;

&lt;p&gt;To include only unique elements from each array, we can use &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set" rel="noopener noreferrer"&gt;Set&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return [...new Set([...arrayOne, ...arrayTwo])];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h4&gt;
  
  
  Let's break down how this solution works:
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;First, we merge the two arrays using the spread operator - just like we did before:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;[...arrayOne, ...arrayTwo]&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then, we wrap the result in a new Set, which removes duplicates.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;new Set([...arrayOne, ...arrayTwo])&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, we convert the Set into an array using the spread operator.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;[...new Set([...arrayOne, ...arrayTwo])]&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>notetoself</category>
      <category>javascript</category>
    </item>
    <item>
      <title>&gt; Remove formatting for test data</title>
      <dc:creator>aronsantha</dc:creator>
      <pubDate>Sun, 24 Sep 2023 13:05:43 +0000</pubDate>
      <link>https://dev.to/aronsantha/displaying-test-code-jed</link>
      <guid>https://dev.to/aronsantha/displaying-test-code-jed</guid>
      <description>&lt;p&gt;Use &lt;code&gt;&amp;lt;pre&amp;gt;&lt;/code&gt; tags during development to print data with unformatted text. It will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;display a fixed-width font, and&lt;/li&gt;
&lt;li&gt;preserve spaces and line breaks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;FYI, most browsers use these styles to format &lt;code&gt;&amp;lt;pre&amp;gt;&lt;/code&gt; tags:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  display: block;
  font-family: monospace;
  white-space: pre;
  margin-top: 1em;
  margin-bottom: 1em;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>notetoself</category>
      <category>html</category>
    </item>
    <item>
      <title>&gt; ACCESS GRANTED</title>
      <dc:creator>aronsantha</dc:creator>
      <pubDate>Fri, 25 Aug 2023 09:17:34 +0000</pubDate>
      <link>https://dev.to/aronsantha/-access-granted-37km</link>
      <guid>https://dev.to/aronsantha/-access-granted-37km</guid>
      <description>&lt;p&gt;&lt;em&gt;Hey Future/Past Aron,&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I've been worried sick you wouldn't find my Multidirectional Chronocapsule... But you did! Well done! 🙌🏻&lt;/p&gt;




&lt;p&gt;Sidenote:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you happen to be an imposter&lt;/strong&gt; (and NOT Aron), I've got a couple of things to tell you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Firstly: Shame on you for reading my personal notes! 😠&lt;/li&gt;
&lt;li&gt;Still, your Multidirectional-Chronocapsule-finding skills amaze me! So, go ahead and take a look... and I hope you'll find my notes useful. 🤗&lt;/li&gt;
&lt;li&gt;And if they don't quite cut it: tough luck! That's what you get for snooping through my private stuff. 😠&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;End of sidenote.&lt;/p&gt;




&lt;p&gt;Now, I know what you're thinking: &lt;strong&gt;what the heck is a Multidirectional Chronocapsule&lt;/strong&gt;? 👀&lt;/p&gt;

&lt;p&gt;Well... it's a time capsule that defies temporal constraints, offering access to its contents across the space-time continuum. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In very simple terms&lt;/strong&gt; (I'm looking at you, Curious George): I'm using it to send notes for myself in the past (things I wish I knew before) and in the future (stuff that I should remember later).&lt;/p&gt;

&lt;p&gt;The notes typically (but not always) fall into one of these &lt;strong&gt;three categories&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Note to Self&lt;/strong&gt;: Personal discoveries, reflections, and practical takeaways from my professional journey as a software engineer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Code Capsules&lt;/strong&gt;: Code snippets of clever solutions and not-so-clever-but-life-saving hacks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Learning Archives&lt;/strong&gt;: Documenting the lessons and wisdom gained from external sources (courses, books, etc).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Alright, I've gotta go! And you can dive right in... 😉&lt;/p&gt;

&lt;p&gt;&lt;em&gt;See you around! 👋&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Aron&lt;/em&gt;&lt;/p&gt;

</description>
      <category>firstpost</category>
      <category>notetoself</category>
      <category>codecapsule</category>
      <category>learningarchives</category>
    </item>
  </channel>
</rss>
