THE ODIN PROJECT: FOUNDATIONS - CALCULATOR | PROJECT SOLUTION

Sdílet
Vložit
  • čas přidán 27. 08. 2024
  • 📚 Join the Waitlist for our next Bootcamp in September - codingdors.com...
    👨‍💻 Learn How to Code with Private Classes - www.codingdors...
    💡 Get Our Solutions and an eBook on "The Top Mistakes People Make when Learning How to Code" - www.codingdors...

Komentáře • 41

  • @DorsCodingSchool
    @DorsCodingSchool  Před rokem +1

    👨‍💻 Learn How to Code with Private Classes - www.dorscodingschool.com/coachingplans
    ❓Having a hard time with CS50, FreeCodeCamp or Odin Project? Practice with our exclusive free coding platform: www.codingdors.com/
    🎯 Are You A Coding Expert? Take Our Free Quiz and Find Out - www.dorscodingschool.com/quiz

  • @BigTimeTimmyJim908
    @BigTimeTimmyJim908 Před rokem +4

    Thank you for the video, it's very helpful and informational. I noticed that when you try to follow up after a calculation there's a bug or error. Example: if you add 1 + 2 = 3 and then press (+) operator to continue adding to the 3 it instead returns the (+2) from the previous calculation. What I did to solve this is was add "currentValue = previousValue" inside the calculate function at the end of each if statement.
    Ex:
    if(operator ==="+"){
    previousValue += currentValue;
    currentValue = previousValue;
    }..........
    What I think was happening was currentValue wasn't being updated and remained the same every time we pressed any other operator.
    Again thank you for these making these videos. They're very valuable.

    • @user-id7tt9le4o
      @user-id7tt9le4o Před 9 měsíci +1

      thanks for sharing. I experienced same bug and your recommendation helped fix it.

    • @afgsdfds
      @afgsdfds Před měsícem

      thanks man for helping

  • @Blackdiamond929_
    @Blackdiamond929_ Před měsícem +1

    New to JavaScript I’ve seen many calculators but this one seems more like my logic 😊

  • @beingold
    @beingold Před 2 měsíci +1

    appreciate for your effort but I wish you went step by step along side with project explanations on the website.

  • @KH2FAN20
    @KH2FAN20 Před rokem +1

    Thank you for making this video! Your solution helped alot because I was getting really stuck in this project. I learnt a lot of new things as well in the process of doing it too!

  • @rodrigo8413
    @rodrigo8413 Před rokem +4

    Great tutorial. It helps a lot that you explain small important details. I got stuck in my project and this gave me a few good ideas to try again :)

  • @letrongdu7951
    @letrongdu7951 Před rokem +1

    it is super useful very clean and easy to understand. I've been trying to find other solutions on the internet but they are super complicated and this is exactly what I need

  • @boyacosweep
    @boyacosweep Před rokem +1

    This was really good. I wish I had found you before being stuck for three days trying to figure this calculator out. You should make more room on the screen by removing the minimap and making the browser window narrower so that you can make the text MUCH bigger. Indenting by 2 spaces would also help you make it more compact.

    • @DorsCodingSchool
      @DorsCodingSchool  Před rokem

      Thank you! :)

    • @mesakhlolo8611
      @mesakhlolo8611 Před rokem

      @@DorsCodingSchool please make the vs code font bigger, so viewers can see it easily. thanks

  • @robscherer
    @robscherer Před rokem +1

    This is an incredibly helpful and well-done video! Thank you for all that you do!!

  • @agstab1810
    @agstab1810 Před 5 měsíci +4

    I "fixed" what seemed to be missing (being able to calculate each individual operator, without clicking equal)
    I set the initial variables to:
    let previousValue = '0'
    let operator = '+'
    then added calculate within handleOperator:
    function handleOperator (op) {
    calculate()
    operator = op
    currentValue = ''
    }

  • @sakshigosain238
    @sakshigosain238 Před rokem +1

    why is the operator displayed in the current screen? or, how? i cant seem to understand the logic in the code to how it was able to stay in the current screen before it got moved to the previous screen

    • @DorsCodingSchool
      @DorsCodingSchool  Před rokem

      We’d love to help you more. Did you know you can join our Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @pahoolk
    @pahoolk Před rokem +1

    Thanks for this tutorial was pretty useful!... but how can I limit the number of zeros in the calcualtor to just one zero?? and make multiple operations like 1+2-3*1??. Thanks!

  • @belalkhaleel7862
    @belalkhaleel7862 Před 11 měsíci +1

    can you plz explain this line?
    currentValue = previousValue.toString();

  • @blahblahblah5924
    @blahblahblah5924 Před rokem +6

    While I appreciate these videos since there's a lot to learn and I really like your coding/teaching style. But what would be better is if you follow their instructions and code step by step. I know that would result in longer videos, but people who are willing to learn and are coming from The Odin Project wouldn't mind that. Otherwise it just becomes another video on how to make a calculator.

    • @DorsCodingSchool
      @DorsCodingSchool  Před rokem +1

      Thank you for your message. We will try to make it better :)

  • @whiskers08spot09
    @whiskers08spot09 Před rokem +2

    At 15:43 am I able to just put my Script tag below the body of my HTML file to avoid the AddEventListener for 'DOMContentLoaded' ?

    • @DorsCodingSchool
      @DorsCodingSchool  Před rokem

      You can try it out, but using the DOMContentLoaded is the best solution ;)

    • @troyjosehipona3251
      @troyjosehipona3251 Před rokem +1

      Or linking a javascript to a head tag with a keyword defer?

    • @whiskers08spot09
      @whiskers08spot09 Před rokem +1

      @@troyjosehipona3251 I just learned this two days ago haha

  • @Victor-Ike
    @Victor-Ike Před rokem +1

    What platform are you using as your local repository?

  • @TheAnalyst-oh3xf
    @TheAnalyst-oh3xf Před 9 měsíci

    Excellent video, however there seems to be a gap in the functionality of the calculator- right now this code is unable to string several operations together. Nevertheless, this was an excellent explanation. Cheers!

    • @TheAnalyst-oh3xf
      @TheAnalyst-oh3xf Před 9 měsíci

      One way to solve this would be to modify the handle operator function to something like this - *function handleOperator(op){
      previousOperator = operator;
      operator = op;
      if(previousValue != "" && currentValue != ""){
      calculate(previousOperator);
      };
      previousNum = currentNum;
      currentNum = "";
      }*

    • @eeposada
      @eeposada Před 5 měsíci

      Can you explain this more? I'm stuck on this exact problem as well and I can't figure it out.

  • @shreyanshsrivastava4349
    @shreyanshsrivastava4349 Před 3 měsíci

    What did you do to change the font-size 09:35

    • @shreyanshsrivastava4349
      @shreyanshsrivastava4349 Před 3 měsíci +1

      Found the solution: The last property overrides any previous one so, I just shifted the link of my stylesheet below the bootstrap link element in my html file.

  • @vaxutucuna
    @vaxutucuna Před rokem +1

    This is a great tutorial, except it does not satisfy the odin project calculator assignment requirements. for example:
    "Users should be able to string together several operations and get the right answer, with each pair of numbers being evaluated at a time. For example, 12 + 7 - 5 * 3 = should yield 42."
    As this projects stands, the user needs to press the = sign to evaluate each operation.
    We should include the ability to evaluate any existing operations while clicking on the operand as well as equal sign.
    I've been trying to do this but have come to dead ends with the structure given in this example.
    Any advise how to implement the feature without rewriting the entire code?

    • @eeposada
      @eeposada Před 5 měsíci

      Did you find a solution for this?

  • @ahmedalimuhammed8501
    @ahmedalimuhammed8501 Před 2 lety +1

    Can you please continue projects of CS50 web programming with python and JavaScript

    • @DorsCodingSchool
      @DorsCodingSchool  Před 2 lety +1

      Soon all the projects will be in our channel :)
      By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 1 hour of group coaching every month!
      Check www.dorscodingschool.com/products

    • @ahmedalimuhammed8501
      @ahmedalimuhammed8501 Před 2 lety

      @@DorsCodingSchool thanks ❤️❤️