<?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>Forem: Olayemi Elsie</title>
    <description>The latest articles on Forem by Olayemi Elsie (@olayemi_elsie).</description>
    <link>https://forem.com/olayemi_elsie</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%2F3726652%2F28dca3ab-e897-4d41-aaec-3b6558224d1f.jpg</url>
      <title>Forem: Olayemi Elsie</title>
      <link>https://forem.com/olayemi_elsie</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/olayemi_elsie"/>
    <language>en</language>
    <item>
      <title>My Learning Journey as a Developer</title>
      <dc:creator>Olayemi Elsie</dc:creator>
      <pubDate>Mon, 30 Mar 2026 09:23:28 +0000</pubDate>
      <link>https://forem.com/olayemi_elsie/my-learning-journey-as-a-developer-nhn</link>
      <guid>https://forem.com/olayemi_elsie/my-learning-journey-as-a-developer-nhn</guid>
      <description>&lt;p&gt;I started this learning journey with a mix of anxiety and determination.&lt;/p&gt;

&lt;p&gt;At the time, I relied heavily on tutorials and artificial intelligence. If I couldn’t find a guide that matched my exact problem, I often felt stuck.&lt;/p&gt;

&lt;p&gt;Today, that has completely changed.&lt;/p&gt;

&lt;p&gt;When I began, I struggled with low confidence in making technical decisions. My mindset was simple: find a tutorial, follow it, and make it work or use AI to generate code without really thinking about why the implementation was done a certain way. My goal was just to make things work, but I wasn’t truly learning. I was copying patterns without understanding them.&lt;/p&gt;

&lt;p&gt;The Turning Point: Learning “Why,” Not Just “How”&lt;/p&gt;

&lt;p&gt;One of the biggest shifts in my journey was how I approached learning.&lt;/p&gt;

&lt;p&gt;I started doing deeper research, reading documentation more carefully, and breaking problems down before jumping into code. It was harder and sometimes slower, but it pushed me beyond my comfort zone and helped me gain a real understanding of what I was building.&lt;/p&gt;

&lt;p&gt;What I’ve Gained&lt;/p&gt;

&lt;p&gt;I’ve seen real growth in my JavaScript, and I’ve become more independent in how I approach problems.&lt;/p&gt;

&lt;p&gt;More importantly, my mindset has changed.&lt;/p&gt;

&lt;p&gt;I’ve learned that real growth starts when you slow down, ask why, and challenge yourself to think critically.&lt;/p&gt;

&lt;p&gt;It’s not always easy.&lt;br&gt;
But it’s always worth it.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>devjournal</category>
      <category>learning</category>
    </item>
    <item>
      <title>Vue 3 Task Manager App: Problem-Solving Approach</title>
      <dc:creator>Olayemi Elsie</dc:creator>
      <pubDate>Sun, 01 Mar 2026 14:04:16 +0000</pubDate>
      <link>https://forem.com/olayemi_elsie/problem-solving-3nim</link>
      <guid>https://forem.com/olayemi_elsie/problem-solving-3nim</guid>
      <description>&lt;p&gt;Developing a Task Manager application using Vue 3 focused on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Component composition&lt;/li&gt;
&lt;li&gt;Props and events&lt;/li&gt;
&lt;li&gt;State management&lt;/li&gt;
&lt;li&gt;Composables&lt;/li&gt;
&lt;li&gt;Clean structure and separation of concerns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What the Task Manager App Does&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Task Manager allows users to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add tasks&lt;/li&gt;
&lt;li&gt;Mark tasks as completed&lt;/li&gt;
&lt;li&gt;Delete tasks&lt;/li&gt;
&lt;li&gt;Toggle all tasks (Check All / Uncheck All)&lt;/li&gt;
&lt;li&gt;Delete all tasks&lt;/li&gt;
&lt;li&gt;Switch between dark and light mode&lt;/li&gt;
&lt;li&gt;Edit tasks inline&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;PLANNING PHASE&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before writing code, I thought about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where should the task state live?&lt;/li&gt;
&lt;li&gt;How will components communicate?&lt;/li&gt;
&lt;li&gt;Should I use local state or a shared composable?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Breaking Down the Problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I split the app into smaller parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TaskManager (parent)&lt;/li&gt;
&lt;li&gt;CardViewComponent&lt;/li&gt;
&lt;li&gt;CheckAllBtns&lt;/li&gt;
&lt;li&gt;EmptyState&lt;/li&gt;
&lt;li&gt;useTasks (composable)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This made the app easier to understand and maintain, though I didn't &lt;br&gt;
plan all the UX requirements at first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;KEY DESIGN DECISIONS&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Composable for State Management&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Problem: Multiple components needed access to task data&lt;/li&gt;
&lt;li&gt;Decision: Created useTasks composable&lt;/li&gt;
&lt;li&gt;Reason: Centralizes task data and most operations&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Separate Components&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Problem: App growing too large&lt;/li&gt;
&lt;li&gt;Decision: Split into focused components&lt;/li&gt;
&lt;li&gt;Reason: Easier to read, maintain, and debug&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Slots in EmptyState&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Problem: Need flexible empty state content&lt;/li&gt;
&lt;li&gt;Decision: Use slots instead of props&lt;/li&gt;
&lt;li&gt;Reason: Slots pass content (HTML), props pass data&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;CSS Classes for Theming (Not Dynamic Components)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initial mistake: Created both CardView and ListView thinking I needed separate components for light and dark modes&lt;/li&gt;
&lt;li&gt;Problem: Both components had identical code only CSS colors differed&lt;/li&gt;
&lt;li&gt;Realization: Dark/light mode is a styling concern, not a component structure concern&lt;/li&gt;
&lt;li&gt;Decision: Deleted ListView, used CSS class binding instead: &lt;code&gt;:class="isDark ? 'dark' : 'light'"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Reason: One component with dynamic CSS classes is cleaner than duplicating components for themes&lt;/li&gt;
&lt;li&gt;Lesson: Dynamic components are for structurally different layouts (grid vs list), not for styling variations (light vs dark)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;CHALLENGES &amp;amp; SOLUTIONS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge 1: Misunderstanding Dynamic Components and Duplicate State&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What went wrong: Initially thought I needed separate components (CardView and ListView) for light and dark themes. While building ListView, I created a local tasks array in both files&lt;/li&gt;
&lt;li&gt;Problems discovered:

&lt;ol&gt;
&lt;li&gt;Both components had identical structure only CSS differed (wrong use of dynamic components)&lt;/li&gt;
&lt;li&gt;ListView's local tasks array didn't sync with CardView's composable based tasks (duplicate state)&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Why sync failed: CardView and ListView were using two separate task arrays in different locations, not one shared source&lt;/li&gt;
&lt;li&gt;Fix: 

&lt;ol&gt;
&lt;li&gt;Realized theming is a CSS concern, not a component concern&lt;/li&gt;
&lt;li&gt;Deleted ListView entirely&lt;/li&gt;
&lt;li&gt;Implemented theming with CSS class binding: &lt;code&gt;:class="isDark ? 'dark' : 'light'"&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Lessons learned:

&lt;ul&gt;
&lt;li&gt;Dynamic components = Different structures/layouts (e.g., grid vs list)&lt;/li&gt;
&lt;li&gt;CSS classes = Different styles/themes (e.g., light vs dark)&lt;/li&gt;
&lt;li&gt;Multiple views must share the SAME data source from composable, not create separate copies&lt;/li&gt;
&lt;li&gt;Don't duplicate components when CSS can solve the problem&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Challenge 2: deleteAllTasks location&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What went wrong: Placed in child component initially&lt;/li&gt;
&lt;li&gt;Problem: Child shouldn't manage global state&lt;/li&gt;
&lt;li&gt;Fix: Moved to parent component, triggered via events&lt;/li&gt;
&lt;li&gt;Current state: Still in parent (TaskManager.vue)&lt;/li&gt;
&lt;li&gt;Lesson: Child emits events; parent/composable manages state&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Challenge 3: Missing UX requirements&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What went wrong: Didn't plan for:

&lt;ul&gt;
&lt;li&gt;Text overflow (long task names)&lt;/li&gt;
&lt;li&gt;Empty state display&lt;/li&gt;
&lt;li&gt;Visual feedback for completed tasks&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Fix: 

&lt;ul&gt;
&lt;li&gt;Added truncateText() function (max 30 characters)&lt;/li&gt;
&lt;li&gt;Created EmptyState component&lt;/li&gt;
&lt;li&gt;Added linethrough styling for completed tasks&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Lesson: Plan UX requirements well before implementation, not just functionality&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Challenge 4: Slots vs Props&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What went wrong: Tried passing empty state content via props&lt;/li&gt;
&lt;li&gt;Problem: Props only handle simple data (strings, numbers), not HTML or components&lt;/li&gt;
&lt;li&gt;Fix: Used slots for flexible content can now pass any HTML, icons, or components&lt;/li&gt;
&lt;li&gt;Lesson: 
Props = data, 
Slots = content&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;KEY TAKEAWAYS&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Component vs CSS&lt;/strong&gt;: Don't create separate components for styling differences use CSS classes for themes. Dynamic components should only be used when components are structurally different.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Single Source of Truth&lt;/strong&gt;: Multiple views must share the SAME data source (composable), not create duplicate state. Changes to shared data should reflect everywhere immediately.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Architectural Consistency&lt;/strong&gt;: All operations on shared state should live in one place (composable) for consistency and maintainability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;UX Planning&lt;/strong&gt;: Important UX requirements (empty states, text handling, visual feedback) should be considered during planning, not added during execution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Understanding Tools&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic components = Different structure/functionality (CardView grid layout vs ListView vertical layout)&lt;/li&gt;
&lt;li&gt;CSS classes = Different appearance/theme (light mode vs dark mode)&lt;/li&gt;
&lt;li&gt;Using the wrong tool leads to code duplication and complexity&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Planning and breaking the app into components made implementation easier. Recognizing when I was overcomplicating things (separate components for themes) and understanding the right tool for each job (CSS vs dynamic components) were important lessons in building maintainable Vue applications.&lt;/p&gt;

</description>
      <category>programming</category>
    </item>
    <item>
      <title>Component Composition &amp; State Flow</title>
      <dc:creator>Olayemi Elsie</dc:creator>
      <pubDate>Sat, 14 Feb 2026 06:41:48 +0000</pubDate>
      <link>https://forem.com/olayemi_elsie/component-composition-state-flow-i68</link>
      <guid>https://forem.com/olayemi_elsie/component-composition-state-flow-i68</guid>
      <description>&lt;p&gt;Component composition is how we build complex UIs by combining smaller, reusable components.&lt;/p&gt;

&lt;p&gt;Instead of one big component, we break it into smaller pieces.&lt;/p&gt;

&lt;p&gt;These smaller components can be nested, reused, and organized to create the full UI.&lt;/p&gt;

&lt;p&gt;State flow is how data moves between components in an application.&lt;/p&gt;

&lt;p&gt;Parent → Child: via props&lt;/p&gt;

&lt;p&gt;Child → Parent: via events ($emit)&lt;/p&gt;

&lt;p&gt;Shared / global state: for siblings or distant components (using reactive stores or composables)&lt;/p&gt;

&lt;p&gt;Key idea: State flow ensures all components stay in sync and respond correctly when data changes.&lt;/p&gt;

&lt;p&gt;Props&lt;/p&gt;

&lt;p&gt;Props are communication between Parent &amp;amp; Child Component. (short for “properties”)&lt;/p&gt;

&lt;p&gt;A parent component sends data to a child component through props. A child component cannot send data directly to its parent. Instead, the parent passes a function as a prop to the child, and the child calls that function to send data back up&lt;/p&gt;

&lt;p&gt;Passing props from Parent → Child&lt;br&gt;&lt;br&gt;
Passing props from Child → Parent Component  &lt;/p&gt;

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

&lt;p&gt;Parent Component&lt;br&gt;
    &lt;/p&gt;

&lt;p&gt;Child Component&lt;br&gt;
const props = defineProps({&lt;br&gt;
  title: String&lt;br&gt;
})&lt;/p&gt;

&lt;p&gt;Accessing prop in the template&lt;/p&gt;


&lt;h1&gt; {{ title }} &lt;/h1&gt;
&lt;br&gt;


&lt;p&gt;Accessing prop in script&lt;/p&gt;

&lt;p&gt;const props = defineProps({&lt;br&gt;
  title: {&lt;br&gt;&lt;br&gt;
type: String,&lt;br&gt;&lt;br&gt;
default: "No title specified"&lt;br&gt;&lt;br&gt;
}})&lt;/p&gt;

&lt;p&gt;Composables&lt;/p&gt;

&lt;p&gt;Composables are the Vue3 equivalent of mixins in the options API.&lt;br&gt;
They allow us to extract reusable logic (state and functions) into a separate file so we can reuse it in different components.&lt;br&gt;
Instead of repeating code in many components, we write the logic once and import it where needed.&lt;/p&gt;

&lt;p&gt;Creating a Composable&lt;/p&gt;

&lt;p&gt;A composable is a function  that contains reactive state and methods  are returned what we want to use and then we export it. &lt;/p&gt;

&lt;p&gt;Note: &lt;br&gt;
It is important to name composable files starting with "use" e.g useDarkMode.js and to use camelCase for the file name.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
 useCounter.js&lt;/p&gt;

&lt;p&gt;import { ref } from 'vue'&lt;/p&gt;

&lt;p&gt;export default function useCounter() {&lt;br&gt;&lt;br&gt;
const count = ref(0)&lt;br&gt;&lt;br&gt;
function increment() {&lt;br&gt;&lt;br&gt;
count.value++&lt;br&gt;&lt;br&gt;
}&lt;br&gt;&lt;br&gt;
function decrement() {&lt;br&gt;
    count.value--&lt;br&gt;&lt;br&gt;
}&lt;br&gt;&lt;br&gt;
return { count, increment, decrement }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;ref(0) → creates reactive state&lt;br&gt;&lt;br&gt;
increment() and decrement() → functions that modify state&lt;br&gt;&lt;br&gt;
return {} → exposes what we want to use in components&lt;br&gt;&lt;br&gt;
export → allows us to reuse it anywhere.&lt;/p&gt;

&lt;p&gt;The return exposes the composable’s state and functions as an object.&lt;br&gt;
When you import the composable in the vue component and destructure it, the  component can see and use those state values and functions directly.&lt;/p&gt;

&lt;p&gt;useCounter.vue&lt;/p&gt;

&lt;p&gt;&amp;lt;script&amp;gt;&lt;br&gt;
Import  useCounter.js from ......&lt;/p&gt;

&lt;p&gt;useCounter.vue&lt;br&gt;
// object destructuring gives you access &lt;br&gt;
const { count, increment, decrement } = useCounter()&lt;/p&gt;

&lt;p&gt;Events&lt;/p&gt;

&lt;p&gt;Events are how a child component communicates with its parent.&lt;br&gt;
A custom event is like a special message that the child sends to the parent to notify it about something.&lt;/p&gt;

&lt;p&gt;Dynamic Component&lt;/p&gt;

&lt;p&gt;A dynamic component allows the switch between different components at runtime without manually nesting them all in the template.&lt;br&gt;
Instead of writing all possible components in the template, it can render one component at a time based on a variable.&lt;/p&gt;

&lt;p&gt;How it works&lt;br&gt;
&amp;lt;component :is="currentComponent"&amp;gt;&amp;lt;/component&amp;gt;&lt;/p&gt;

&lt;p&gt;:is → binds to a variable that holds the component to  be rendered.&lt;br&gt;&lt;br&gt;
currentComponent → can be a component object.&lt;br&gt;
When currentComponent changes, Vue automatically renders the new component.&lt;/p&gt;

&lt;p&gt;Example&lt;br&gt;
Example: Light Mode / Dark Mode&lt;/p&gt;

&lt;p&gt;&amp;lt;script setup&amp;gt;&lt;br&gt;
import LightMode from './LightMode.vue'import DarkMode from './DarkMode.vue'&lt;/p&gt;

&lt;p&gt;import { ref } from 'vue'&lt;br&gt;
const currentComponent = ref('LightMode')&lt;br&gt;
function toggleMode() {&lt;br&gt;
  currentComponent.value =  currentComponent.value === 'LightMode' ? 'DarkMode' : 'LightMode'}&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
Toggle Mode&lt;br&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;currentComponent determines which component is shown. &lt;br&gt;
Clicking the button switches between LightMode and DarkMode. &lt;br&gt;
 replaces the need to manually nest  and &lt;/p&gt;

&lt;h2&gt;
  
  
  State Management
&lt;/h2&gt;

&lt;p&gt;State management is how data is shared and kept in sync between multiple components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use props and events to pass data between a parent and child.
&lt;/li&gt;
&lt;li&gt;Use global/reactive state when siblings or multiple components need the same data. 
' 
Example:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;// store.js&lt;br&gt;
import { ref } from 'vue'&lt;br&gt;
export const userName = ref('Olayemi')&lt;/p&gt;

&lt;p&gt;import { userName } from './store.js'&lt;br&gt;
function changeName() { &lt;br&gt;
userName.value = 'Olusegun' }&lt;/p&gt;



&lt;p&gt;{{ userName }}&lt;/p&gt;  

&lt;p&gt;&lt;br&gt;
Change Name&lt;/p&gt;

&lt;p&gt;import { userName } from './store.js'&lt;/p&gt;



&lt;p&gt;{{ userName }}&lt;/p&gt;



&lt;p&gt;Changing the value in one component will update it everywhere that uses the same store.&lt;/p&gt;

&lt;p&gt;Notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The default value is shown if the prop is not specified in the parent component. &lt;/li&gt;
&lt;li&gt;defineProps() – No need to import it.Props from Vue docs are automatically available. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Events
&lt;/h2&gt;

&lt;p&gt;A way a Child Component communicates with Parent Component. &lt;br&gt;
A custom event is like a special message that a child component sends to its parent saying something. &lt;br&gt;
Example (Child)&lt;/p&gt;

&lt;p&gt;Dynamic Component&lt;/p&gt;

&lt;p&gt;Switches between different components dynamically. &lt;br&gt;
Example:&lt;/p&gt;

&lt;p&gt;Let’s say we have a Light Mode and Dark Mode. &lt;br&gt;
You want to click on a button to switch between Light &amp;amp; Dark. &lt;br&gt;
This can be achieved by dynamic component. &lt;/p&gt;



&lt;p&gt; is used instead of nesting components directly. &lt;/p&gt;

&lt;p&gt;Composable&lt;/p&gt;

&lt;p&gt;The equivalent of mixin. &lt;br&gt;
It allows us to extract reusable logic &amp;amp; methods and keep them in a separate template so we can reuse them. &lt;br&gt;
Creating a Composable&lt;/p&gt;

&lt;p&gt;We need to create a function for it &amp;amp; export default function. &lt;br&gt;
Example:&lt;/p&gt;

&lt;p&gt;export default function useCounter() {  const count = ref(0)  function increment() {    count.value++  }  return { count, increment }}&lt;/p&gt;

&lt;p&gt;Inside Vue file, we need to import and use it. &lt;/p&gt;

&lt;p&gt;import useCounter from './useCounter'const { count, increment } = useCounter()&lt;/p&gt;

&lt;p&gt;NB&lt;br&gt;
When importing a module: &lt;/p&gt;

&lt;p&gt;import xxx from '...'&lt;/p&gt;

&lt;p&gt;When importing a specific named export: &lt;/p&gt;

&lt;p&gt;import { xxx } from '...'&lt;/p&gt;

&lt;p&gt;Key Points&lt;/p&gt;

&lt;p&gt;Use dynamic v-if if we have many components.&lt;br&gt;&lt;br&gt;
Use composables to make use of reusable logic in Vue.&lt;/p&gt;

</description>
      <category>vue</category>
    </item>
    <item>
      <title>JavaScript Concept</title>
      <dc:creator>Olayemi Elsie</dc:creator>
      <pubDate>Fri, 30 Jan 2026 14:21:09 +0000</pubDate>
      <link>https://forem.com/olayemi_elsie/javascript-concept-5dld</link>
      <guid>https://forem.com/olayemi_elsie/javascript-concept-5dld</guid>
      <description>&lt;p&gt;One of the first and most important concepts you encounter in JavaScript is variables &lt;/p&gt;

&lt;p&gt;JavaScript provides three main ways to declare variables: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;var, &lt;/li&gt;
&lt;li&gt;let, and &lt;/li&gt;
&lt;li&gt;const &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;While they may look similar, they behave very differently. &lt;/p&gt;

&lt;p&gt;Variable&lt;/p&gt;

&lt;p&gt;A variable is like a container that holds a value. You give it a name so you can reference or update that value later in your code. &lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
let age = 16; &lt;/p&gt;

&lt;p&gt;Here, age is assigned to a value of 16.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;var – The Old Way: var is the older method of declaring variables in JavaScript. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Key features of var:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Function scoped&lt;/li&gt;
&lt;li&gt;Can be redeclared&lt;/li&gt;
&lt;li&gt;Can be updated&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
Redeclaration&lt;br&gt;
var fruit = "orange"; // declearation&lt;br&gt;
var fruit = "apple"; //redeclearation&lt;br&gt;
console.log(fruit); // apple&lt;/p&gt;

&lt;p&gt;Making update&lt;br&gt;
var fruit = "orange"; &lt;br&gt;
fruit = "apple";  // update&lt;br&gt;
console.log(fruit); // apple&lt;/p&gt;

&lt;p&gt;Redeclaring a variable may overwrite values unexpectedly, making bugs harder to track. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;let – This was introduced to fix many of the problems caused by var. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Key features of let: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Block scoped can be updated &lt;/li&gt;
&lt;li&gt;redeclared.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example: &lt;br&gt;
let age = 16;   // declaration&lt;br&gt;
age = 17;       // updating (allowed)&lt;br&gt;
console.log(age); // 17&lt;/p&gt;

&lt;p&gt;// Redeclaring in the same scope will cause an error:&lt;br&gt;
let age = 16;&lt;br&gt;
if (true) {&lt;br&gt;
  let age = 18; // allowed, block-scoped&lt;br&gt;
}&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;const – const is used for Fixed Values. const is used for values that should never change. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Key features of const: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Block scoped, &lt;/li&gt;
&lt;li&gt;Cannot be updated and &lt;/li&gt;
&lt;li&gt;Cannot be redeclared. &lt;/li&gt;
&lt;li&gt;It Must be initialized immediately &lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;const country = "Nigeria"; &lt;/p&gt;

&lt;p&gt;Using the correct variable type helps: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prevent bugs&lt;/li&gt;
&lt;li&gt;Make your code more readable&lt;/li&gt;
&lt;li&gt;Improve maintainability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Best Practices for Declaring Variables in JavaScript:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use const by default — for values that should not change.&lt;/li&gt;
&lt;li&gt;Use let only when you need to update or reassign a variable.&lt;/li&gt;
&lt;li&gt;Avoid var in modern JavaScript to prevent unexpected redeclarations            and scope issues.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
