A Day in My Life: Planned vs. Reality (Using 10 JavaScript Array Methods)

A Day in My Life: Planned vs. Reality (Using 10 JavaScript Array Methods)

Here’s how my perfectly planned daily routine turned into a chaotic mess, explained using JavaScript’s top 10 array methods. 🤣

  1. push() – Planning My Day-(it will increase the length of array and return same array)

    The night before, I carefully planned my schedule.

     let myDay = [];
     myDay.push("Wake up at 6 AM", "Workout 🏋️", "Healthy breakfast 🥑", "Work on project 💻", "Read a book 📖", "Sleep at 10 PM");
     console.log("Planned Day:", myDay);
    

    📝 Plan: A productive, healthy, well-balanced day.
    😎 Reality: The plan existed... but my willpower didn’t.

    1. shift() – Snooze Button Wins -(it will remove the first element and reduce array length but return the same array)

      6 AM Alarm: BEEP BEEP
      Me: Just 5 more minutes…

       let firstTask = myDay.shift();
       console.log("Skipped:", firstTask); // "Wake up at 6 AM"
      

      💤 Reality: Woke up at 10 AM instead.

    2. unshift() – Emergency Fix -[it will add specified nos of array at begineeing of array ]

      Now I’m late! Gotta prioritize survival tasks.

       myDay.unshift("Panic shower 🚿", "Quick coffee ☕");
       console.log("Updated Plan:", myDay);
      

      🔥 Reality: Morning routine reduced to speedrunning life.

    3. pop() – Goodbye, Productivity

       let lastTask = myDay.pop();
       console.log("Cancelled:", lastTask); // "Sleep at 10 PM"
      

      🦉 Reality: "Who needs sleep when you have YouTube at 2 AM?"

    4. splice() – Removing the Gym-[splice(index,nos of elements,items to replace with- can be multiple elements)]

      Workout? LOL. NO.

       let removed = myDay.splice(myDay.indexOf("Workout 🏋️"), 1);
       console.log("Avoided:", removed);
      

      💪 Reality: Lifting spoon to mouth counts, right?

    5. slice() – Only Doing Fun Stuff

      What if I only did the fun parts of my plan?

       let funOnly = myDay.slice(1, 3);
       console.log("Things I actually did:", funOnly);
      

      🍕 Reality: Breakfast and scrolling memes took priority.

    6. map() – Adding Excuses to Everything

       let excuses = myDay.map(task => task + " (but later)");
       console.log("Procrastination Mode:", excuses);
      

      📜 Reality: "I'll do it... tomorrow." (Famous last words)

    7. filter() – Removing Boring Stuff

       let importantStuff = myDay.filter(task => task.includes("Netflix") || task.includes("Food"));
       console.log("What I actually did:", importantStuff);
      

      📺 Reality: Netflix and eating… priorities, right?

    8. find() – Last-Minute Productivity

       let lastMinuteWork = myDay.find(task => task.includes("Work"));
       console.log("Almost Did:", lastMinuteWork);
      

      Reality: Opened my laptop, stared at the screen, then closed it.

    9. reduce() – Summing Up My Day

      let summary = myDay.reduce((acc, task) => acc + " ➡️ " + task);
      console.log("Final Day Summary:", summary);
      

      🌀 Reality: A beautiful mess, connected by naps and snacks.

Final Thoughts

  • Planned: Productivity, fitness, self-improvement.

  • Reality: Chaos, procrastination, and a Netflix marathon.

At least I tried… kinda. 😅