Build A Simple Calculator With JavaScript | Mini Project For Beginners

Sdílet
Vložit
  • čas přidán 16. 07. 2024
  • 👉 Check out Kite - A Free AI-powered Coding Assistant (download link):
    www.kite.com/get-kite/?...
    This is the day-28 of #30days30submits. Today we are going to create a simple calculator with vanilla JavaScript. That's a mini JS project for JS beginners & hope you will like it.
    🔔subscribe and turn on the notification bell.
    👉 source code: codepen.io/Web_Cifar/pen/XWdVgXr
    👉 #30days30submits : github.com/ShaifArfan/30days3...
    Timestamps -
    00:00 - Intro
    00:11 - APP Preview
    03:31 - HTML
    11:01 - CSS
    21:02 - JavaScript
    1:11:50 - Outro
    ▶ Also Watch :
    Make a full website with HTML & CSS: • One Page Full Website ...
    HTML & CSS Landing Page : • HTML & CSS Website Lan...
    Mini Project for HTML & CSS : • Responsive Website Wit...
    How To Make A WordPress website: • How To Make A Professi...
    ▶ Some useful Playlist :
    HTML & CSS: • HTML & CSS
    Vanilla JavaScript : • Vanilla JavaScript
    Frontend Mentor Challenges: • Frontend Mentor Challe...
    🌐 Join The Community :
    Our website : webcifar.com/
    Facebook Page : / webcifar
    Facebook group : bit.ly/fb-group-webcifar
    Instagram : / web_cifar
    twitter : / webcifar
    Github: github.com/WebCifar
    #30days30submits #webCifar #javascript
  • Věda a technologie

Komentáře • 74

  • @webcifar
    @webcifar  Před 3 lety +2

    🔔subscribe and turn on the notification bell.
    👉 source code: codepen.io/Web_Cifar/pen/XWdVgXr
    👉 #30days30submits : github.com/ShaifArfan/30days30submits

  • @stevevang506
    @stevevang506 Před 3 lety +11

    The BEST JS calculator tutorial on the web. hands down.

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

    this was an amazing tutorial. the design and code itself are great. this is exactly what i needed to troubleshoot my own calculator app. you definitely earned a thumbs up and a sub. thank you so much

  • @rubaiyabegum1722
    @rubaiyabegum1722 Před 2 lety +3

    got this project done without any suffering....Jazakallah khair

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

    Awesome Tutorial, keep them coming, awesome how you walked through the reasoning for everything!!
    Helped me Alot
    Thank you

  • @TioYoh
    @TioYoh Před 2 lety

    Thank you for the class! I learned a lot!

  • @nikhilraj4098
    @nikhilraj4098 Před 2 lety +6

    Hands down the best calculator on vanilla JavaScript period.
    Every one uses eval function and you hard coded the logic, and you added so much functionality and all this is 1 hour,
    Please make such good projects more that help us in learning how to form logic.
    This video is under-rated

  • @barryowino1485
    @barryowino1485 Před 2 lety

    The best calculator built with vanilla JS...keep it up

  • @Ace718215
    @Ace718215 Před 3 lety +6

    Awesome tutorial brother best js calc tutorial ive seen. keep up the great work

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

    Thank you kindly sir, you are explaining it very well and it was fun to follow along and make this calculator with you

  • @user-em1pp6ys8d
    @user-em1pp6ys8d Před rokem

    Great! Thank you very much! 🙏🙏🙏

  • @rohanshoaib1475
    @rohanshoaib1475 Před 3 lety

    Great Job man!!

  • @chisomannastesia982
    @chisomannastesia982 Před 2 lety

    tank you for this awesome guide. its so beginner friendly

  • @kenethnjoroge5313
    @kenethnjoroge5313 Před 2 lety

    If not for anything, you winned me over as a subscriber coz of this video... Thank you for the great work🔥!

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

    Thanks. A little confused with numbs and elements but helpful tutorial!

  • @Alan-ox2hp
    @Alan-ox2hp Před 3 lety

    Good video, thanks. Good to learn from different sources. many thanks

  • @onyinyechukwuma4272
    @onyinyechukwuma4272 Před 2 lety

    This was so helpful. thanks

  • @elexafm
    @elexafm Před 3 lety +4

    thank you so much for this video. you explained sooo well the logic that i was able to make some changes for my own calculator project. like subscribe and share for this gentleman

  • @shoeb_akter
    @shoeb_akter Před 3 lety +1

    You are AWSOME🔥

  • @samarjamil3053
    @samarjamil3053 Před 3 lety +1

    Great job 👌

  • @sprahzyend7535
    @sprahzyend7535 Před 3 lety

    Good tutorial!

  • @MuhammadAdnan2.0
    @MuhammadAdnan2.0 Před 3 lety +1

    great history feature still watching ,,,,,,,, unique really :D validation as well

  • @istiakahammad7074
    @istiakahammad7074 Před 3 lety +2

    Thanks for this video

  • @riajmahmud4303
    @riajmahmud4303 Před 10 měsíci

    This is the best calculator titurial

  • @dgross4735
    @dgross4735 Před rokem

    Excellent work. One question, What would need to be done to change the color of a key or row of keys like at the top to be a different color than the number set below...?

  • @jassrajput890
    @jassrajput890 Před 3 lety

    awesome

  • @Harrison2
    @Harrison2 Před 3 lety

    dope...going to start on an earlier video

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

    please make video over operator change logic....which we see in the real calculator
    (for example -> we press (*) by mistake, then we change the operator after clicking on the another one)

  • @basseyjennifer5601
    @basseyjennifer5601 Před 3 lety

    thank you

  • @madhavsewag4804
    @madhavsewag4804 Před 2 lety

    How can I do continue calculation with = operator

  • @ohiogozaimasu
    @ohiogozaimasu Před 2 lety

    At line 24 you called mathOperation function()...but you not defined it...how it worked...because when i'm calling that function...it shows error...kindly clear my doubt

  • @alijaafar4055
    @alijaafar4055 Před 2 lety

    forEach loop is giving me an error, why

  • @MuhammadAdnan2.0
    @MuhammadAdnan2.0 Před 3 lety

    Day 29 portfolio something like this. www.templateshub.net/demo/?theme=robert-personal-onepage-html-template

  • @taslucian
    @taslucian Před 11 měsíci

    I like this code. It is verry clean and verry clear, but the calculator is not doing the calculations in the correct order. This is happening because of the temporary result. One example is: 2+3*2 . The result should be 8, but the calculator give the result 10 witch is not correct. How can we fix this?

  • @user-hd2tb3jj8d
    @user-hd2tb3jj8d Před 3 lety +2

    There is a small bug . if second operand is empty and has "." value and when you press equal button the result says NaN. Nevertheless great tutorial

    • @webcifar
      @webcifar  Před 3 lety +1

      Thanks for mentioning it.

  • @lerdrobott549
    @lerdrobott549 Před 3 lety

    This code doesnt follow MDAS

  • @istiakahammad7074
    @istiakahammad7074 Před 3 lety +3

    Can you make a sciencetific calculator?

  • @techwithoge6899
    @techwithoge6899 Před 3 lety

    This is so nice, made something similar to this ya'll can check it out

  • @ahadamin7361
    @ahadamin7361 Před 2 lety

    31:33

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

    Uncaught typeError : numbersE1.forEach is not a function at......... Sir sir why it is happening and what do it for this error. Please tell me

    • @fittingprize8135
      @fittingprize8135 Před 2 lety

      same here, do u find the solution ?

    • @mateuszmichalski6747
      @mateuszmichalski6747 Před 2 lety

      check if you have const numbersEl = document.querySelectorAll(''number'). At first I also had this error but I noticed that I have const set with just .querySelector (without 'All' at the end)

  • @eelguneezmemmedov1671
    @eelguneezmemmedov1671 Před 3 lety +1

    What u say and write i understand clearly but when i start to code by myself i stuck ((( Could u say why ? how u became to this level ?

    • @webcifar
      @webcifar  Před 3 lety

      It happens with everybody. You need to keep trying.

    • @eelguneezmemmedov1671
      @eelguneezmemmedov1671 Před 3 lety

      @@webcifar Thanks for feedback i will do my best!

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

    You need to work more on logic brother , keep it up

  • @ce7083
    @ce7083 Před 3 lety

    Dude, I was follow every step on this video tutorial but my calculator doesn't want to click (unclickable) - What the heck is going on? how I can connect with you? How do I know if you or someone replying this my message in youtube?

    • @ce7083
      @ce7083 Před 3 lety

      Its only the UI that's work, in my code.. pls some help?

    • @webcifar
      @webcifar  Před 3 lety +1

      Check the click eventlistener. If you are still facing the problem just join the facebook group and there you will find me.

    • @ce7083
      @ce7083 Před 3 lety

      @@webcifar Thanks a lot for replying my message dude I really appreciate it, for now I don't have FB account I'll make it & finding you (on it) later..

    • @manjupriyakarthikeyan
      @manjupriyakarthikeyan Před 3 lety

      @@ce7083 same problem for me (unclickable.).if you find a solution for that .help me

    • @tehannasmall2316
      @tehannasmall2316 Před 2 lety

      @@ce7083 hi, did you get the buttons to become clickable?? I don't have Facebook to connect with you

  • @user-ox8is8ve4k
    @user-ox8is8ve4k Před 2 lety

    Ьл

  • @rubelbarua9953
    @rubelbarua9953 Před 2 lety

    Too much code

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

    this tutorial is great but the tutor doesn't explain well. he gets confused many times and can't explain in words cleary what he is doing and why.

    • @webcifar
      @webcifar  Před 2 lety

      Thanks for your feedback.

  • @bineethl2666
    @bineethl2666 Před 3 lety +2

    Kindly clear how can we connect the haveDot to e.target.innertext in this condition -- if (e.target.innertext==='.' &&!have dot)
    havaDot=true;

    • @webcifar
      @webcifar  Před 3 lety

      if we are clicking do (e.target.innertext) and we don't have a dot yet in out number then add the dot also make have Dot true.

    • @bineethl2666
      @bineethl2666 Před 3 lety

      Hello sir,
      I convinced with your point thx a lot but my query is how this condition will understand by calculator if( e.target.innertext == '.'(convinced) &&!haveDot (this condition not convinced mean how calculator will know that we dont have dot previously in a number by this condition because we dont mention anywhere haveDot is equal to '.' And We simply considered haveDot is boolean as false ) )
      Kindly explain please!!!

    • @webcifar
      @webcifar  Před 3 lety +1

      @@bineethl2666 Initially the haveDot value is false but when we are clicking the dot if you can see we are changing the value of haveDot to true. Now it means we have the dot inside the number. After that you can't add another dot in the same number because the haveDot is now true. and when we are adding a new number, if you notice we are again changing the havDat value to false so that user can add dot to the new number.

    • @bineethl2666
      @bineethl2666 Před 3 lety

      @@webcifar thnks a lot 👍

    • @bineethl2666
      @bineethl2666 Před 3 lety

      Why we have given haveDot value is false ; we can give it true also and apply condition vice versa;