Giter Club home page Giter Club logo

3days1project's Introduction

Typing SVG

I'm currently achieving my dreams of becoming a developer by starting off as an apprentice at Griffiths & Armour, where I was constantly learning and honing my programming skills. But that's not all - I'm also an adventurer at heart! I have a burning passion for exploring new programming languages and creating exciting projects that keep me on my toes!

To keep my family, friends, and followers updated on my journey, I share my exciting progress on my blog and Instagram!, where I love to show off my latest projects and give a sneak peek into my daily life. But here's the kicker - I'm not just about self-promotion! I firmly believe in giving back to the community that's helped me along the way. So, I regularly create fun, informative content on my blog that covers everything from the latest tech to programming hacks to innovative studying techniques!

🩶 Currently I am...


💿 Latest Blog Posts

Read more...

🐺 Languages And Technologies

Web Development

HTML badge CSS badge JavaScript badge

Programming Languages

C# badge Python badge Lua badge

Frameworks and Platforms

Django badge Read Read React

Development Tools and Environments

Read Read Read

Database

Read Read

🎧 GitHub Stats



🌫️ My Favourite Projects


3days1project's People

Contributors

izicodes avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

3days1project's Issues

counter project - clicking reset, then add/remove bees does not start at 0.

To reproduce:

  1. Click "+1" 3 times.
  2. Click "Reset."
  3. Click "+1" again.

Expected behavior: Counter shows 1.
Actual behavior: Counter shows 4.

Looks like your event handler for "reset" does not update currentNumber to 0.

Personally, I'd separate the state updates and DOM updates. That way, you can reduce some duplication. It would maybe look like this (untested):

function init() {
  let currentNumber = 0;
  plusBee.addEventListener("click", function () {
    currentNumber++;
    updateHtml(currentNumber);
  });

  minusBee.addEventListener("click", function () {
    currentNumber = Math.max(0, currentNumber - 1); // Minimum number of bees is 0.
    updateHtml(currentNumber);
  });

  resetBtn.addEventListener("click", function () {
    currentNumber = 0;
    updateHtml(currentNumber);
  });
}

function updateHtml(beesCount) {
  numberText.textContent = beesCount;
  messageText.textContent = beesCount > 0
    ? "You've seen " + beesCount + " bees! (´∀`)"
    : "";
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.