Build A Calculator With JavaScript Tutorial

  Рет қаралды 1,530,231

Web Dev Simplified

Web Dev Simplified

Күн бұрын

Projects are the best way to learn JavaScript, and a calculator is one of the best projects to choose. A calculator covers all the complex interactions with UI and JavaScript while still being simple enough for people of any skill level.
In this video I will walk you through the steps it takes to build a completely modern calculator using JavaScript best practices. If you want to learn JavaScript or improve your JavaScript skill this is a must do project.
📚 Materials:
Code: github.com/WebDevSimplified/V...
🧠 Concepts Covered:
- How to use ES6 classes to organize code
- How to sync JavaScript code with a UI
- CSS Grid
- Flexbox
- The best way to cleanly handle user input
- How to debug complicated edge cases
🌎 Find Me Here:
Twitter: / devsimplified
GitHub: github.com/WebDevSimplified
CodePen: codepen.io/WebDevSimplified
#JavaScript #WebDevelopment #Programming

Пікірлер: 1 800
@danielvillegas7013
@danielvillegas7013 3 жыл бұрын
After 10 months of learning HTML+CSS+JS and some React, I just tried making a calculator and realized I couldn't. Now, I watch this video and realized I REALLY couldn't. Lol. Edit 2: July 2023, Two years later, making a 6 figure salary as a front end dev, and I know I still wouldn't be able to make a calculator this good all by myself. Don't give up guys! Learning to code takes time! Edit: I just landed a full time, fully remote front end job guys! Self taught 100%, took me almost two years but it is possible, don't give up! Take the time you need to learn things and master them, even if it seems impossible at first, you can do it :)
@milosleng1175
@milosleng1175 3 жыл бұрын
that is a sad truth. many bootcamps students end up like this. even me lol. I know people who claim to be full-stack developers because they did udemy courses, but when you tell them to build a calculator, they are clueless. It is not as simple as it seems. Better to work hard on as many projects as possible, and if you really get stuck, let;s say, for a week, find help. I got stuck on this, so here I am :D
@milosleng1175
@milosleng1175 3 жыл бұрын
@Josiah Eridius totally agree. It is a different story when you try to build smh on your own lmao. did you move on during this month?
@milosleng1175
@milosleng1175 3 жыл бұрын
@Josiah Eridius I've been learning Js from scratch for 4 months 8 hours a day and I have not noticed any improvement. I still don't get logic and some difficult parts as async.and that's just a theory.! It gets event worse when I see the real code bro...a disaster
@emreozgun3846
@emreozgun3846 3 жыл бұрын
@Josiah Eridius I know I shouldn't be freaked out but tryna grasp these concepts and struggling with comprehending them makes me question myself...
@andresramirez4469
@andresramirez4469 2 жыл бұрын
@Titan Coder its not recommended but for calculators its ok. Its a real gimme. Thats how i finished mine.
@davidarogunre7251
@davidarogunre7251 3 жыл бұрын
Me: I can build a calculator Me after watching this video:I don't know Javascript
@sypo_x1891
@sypo_x1891 3 жыл бұрын
that exactly what happened to me omg i thought i knew JavaScript
@tayza3838
@tayza3838 3 жыл бұрын
LOL
@MT-od6by
@MT-od6by 3 жыл бұрын
same lmao
@men00000able
@men00000able 3 жыл бұрын
@Dominic Forest how javascript works with you???
@hichembouallegue
@hichembouallegue 3 жыл бұрын
me too lol
@matthew65536
@matthew65536 Жыл бұрын
I'm not proud to admit this, but this is how I learned what AC means on a calculator.
@jashgudhka2660
@jashgudhka2660 9 ай бұрын
You are not alone!
@remomagalhaes4707
@remomagalhaes4707 3 ай бұрын
same here!!!
@namatamataba784
@namatamataba784 3 ай бұрын
all clear, i was todays' years old
@sandVidz
@sandVidz 3 жыл бұрын
Everything is fun and games until JavaScript starts.
@21thcenturytoad
@21thcenturytoad 3 жыл бұрын
he's bad at explaining js in this video i guess he oversimplified it too much
@kaangamgimginnkagnagnkingmngkn
@kaangamgimginnkagnagnkingmngkn 3 жыл бұрын
JavaScript is fine enough, go see Java.
@cliftonjohnson1288
@cliftonjohnson1288 3 жыл бұрын
+
@cliftonjohnson1288
@cliftonjohnson1288 3 жыл бұрын
@@21thcenturytoad ?⏪
@LUKFUNTV
@LUKFUNTV 3 жыл бұрын
@Saumil no not at all
@skh.visuals
@skh.visuals 5 жыл бұрын
I've watched a TON of JS calculator tutorials, even inspected codes from actual online calculators to find the best way to approach it and you are hands down the best when it comes to efficiency and logic, +1 sub
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
Thank you! I am really glad you enjoyed it.
@UmarAlFarooq
@UmarAlFarooq 3 жыл бұрын
@Titan Coder Try this repo: github.com/UmarAlFarooq/SimpleCalc
@yt-sh
@yt-sh 3 жыл бұрын
@Titan Coder eval is bad mmkay
@yt-sh
@yt-sh 3 жыл бұрын
thanks for the comment and your work, helps to rank developers' videos
@kinstar
@kinstar 2 жыл бұрын
@Titan Coder theres a reason why someone might not want to eval()
@kartikugemuge8361
@kartikugemuge8361 2 жыл бұрын
I was here a week ago I understood nothing .. I hustled some js concepts and now this is so clear .. not a video for beginners but great for people in the learning phase .. the way you used events is so cool!! Never thought u could call functions from an event .. makes everything soo much simpler
@StrangerDanger352
@StrangerDanger352 Жыл бұрын
Hey can you please explain me how is he accessing clear() function property this.currentOperand and this.previousOperand to another functions?
@viriv
@viriv Жыл бұрын
@@StrangerDanger352 i recommend you watch a video on how 'this' works, i think that will answer your questions
@Rachelchizurum
@Rachelchizurum 10 ай бұрын
I did same thing u did on this calculator code but my was showing different things from CSS stage I crossed every code nothing was missing why I'm not getting exactly how the calculator u display looks and works pls I need to guidelines here
@19jewels95
@19jewels95 3 жыл бұрын
Shit. I started to learn JS 1-2 months ago, but went back to CSS because I realised I didn't really grasp the concepts and swepted over the topics too hastily. Now I thought I had a base understanding of JS, but coming back to it, I'm realising I'm definitely still in the 'frustrated learning' phase 😩
@princesiachin279
@princesiachin279 3 жыл бұрын
yeahhh same here. this driving me crazy🤯
@sillyfella2009
@sillyfella2009 3 жыл бұрын
Bruh Counter Strike: Source is dead
@shammirbaig2877
@shammirbaig2877 3 жыл бұрын
Same here😂
@a4yster
@a4yster 3 жыл бұрын
Keep on learning. I started to learn code last oct-nov and got my first job in may. Wage suck, but as of yet so does my code.
@unscripted483
@unscripted483 3 жыл бұрын
now what you should do is go through a bunch of videos relating to concepts only. These project based tutorials are helpful to learn about practical uses for concept you may not know but they don't help you understand them. When ever you do these project tutorials you should write down on a piece of paper of the concepts and methods you were not familiar and do some research on them after wards.
@neatpolygons8500
@neatpolygons8500 4 жыл бұрын
You're amazing :) as an experienced dev who came from other languages I find it very dull watching other tutorials that go through the basics very slowly. I really enjoyed watching you work and following at the same time. great work.
@DucTaZenSurfer
@DucTaZenSurfer Жыл бұрын
wow, I've studied and watched a ton of YT videos on programming and I have to agree with everyone else on this comment that yours by far has been the more precise and clear. So easy to understand what we're doing. Thank you for this, the videos 3 years old yet super relevant today for me! Thanks
@renan.almeidah
@renan.almeidah Жыл бұрын
I challenged myself and was able to create a % (percentage) button, and transformed everything to work with commas instead of periods as decimal separator because of my locale. Now, I will try to create a memory side panel which will store the last 5 calculations. Thank you so much for this video! I never had so much fun learning JavaScript, because all I did was copying and pasting code from the internet into my little web widgets. Now, I could fully understand concepts and took notes of everything that never entered my head, such as arrow functions and constructor classes.
@jashgudhka2660
@jashgudhka2660 9 ай бұрын
I am trying to follow this tutorial, a beginner here. And that was exactly my plan to add to this project, last 5-10 calculations would look cool.
@tornado2783
@tornado2783 3 ай бұрын
currently challenging my self to turn it into a scientific calculator, the break throughs feel like I could rule the world LMAOO
@santhoshnoronha4
@santhoshnoronha4 4 жыл бұрын
One of the best tutorials I have ever seen like no mistakes or anything Good job GG
@halusky
@halusky 2 жыл бұрын
Appreciate this! I've been coding with JS for a couple of years already, but I'm prepping for a FAANG interview and severely need to brush up on my vanilla JS skills (I've been in React World for way too long). The class-based approach is definitely the way to go, and it's something that I've always avoided implementing in my own solutions in favor of just cramming my JS file full of variables and functions. Very clean and very organized.
@meryemar7403
@meryemar7403 3 жыл бұрын
your voice makes me comfortable. I really appreciate that you making these videos.
@tristant7882
@tristant7882 4 жыл бұрын
I came for the calculator, but I left with much more. Thank you for explaining all you do!
@EnterJester
@EnterJester 3 жыл бұрын
21:41 why it's not working? I wrote this.currentOperand = number and it wroked. it added one number each time but when I changed it to this.currentOperand = this.currentOperand.toString() + number.toString() nothing happend..why? there is nothing in the black area.
@JaydRobinson-xx5yx
@JaydRobinson-xx5yx 4 жыл бұрын
This tutorial was fine. Well explained. Sometimes you need to understand rather than copy. No programmer remembers every single line of code. +1 sub
@lowiehojas5525
@lowiehojas5525 Жыл бұрын
I tried to create a calculator in javascript and was unsuccessful; but I never thought it would be this complicated. I still couldn't totally grasp on how the Class works. Your work is amazing!
@savannahlin8063
@savannahlin8063 5 жыл бұрын
I like this course because it is so practical and useful. Thank you so much.
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
You are very welcome!
@skudnu5462
@skudnu5462 3 жыл бұрын
amazing tutorial, not exactly for beginners, since you take a lot of stuff for granted when it comes to the javascript part, but for me that was exactly what i was looking for
@bkosimi
@bkosimi 2 жыл бұрын
Excellent tutorial that’s not too long or complicated. Definitely helpful when starting up with concepts. Appreciate it, bro! Long live! :)
@CubingEmperor313
@CubingEmperor313 7 ай бұрын
no to long
@muhammadshahzeb8274
@muhammadshahzeb8274 4 жыл бұрын
absolutely loved this tutorial!!! THANKS SO MUCH.
@edgarspujats8282
@edgarspujats8282 2 жыл бұрын
I built my own calculator, it works completely fine. But watching this video i realised how far i am from being good. Your code is so clean and structured, and the methods are so optimal. I need to learn more JavaScript...
@youcefhhh7268
@youcefhhh7268 2 жыл бұрын
hey , can you update us
@wasserruebenvergilbungsvirus
@wasserruebenvergilbungsvirus Жыл бұрын
I was only able to actually understand what he was doing up until minute 21 or so. Feeling dumb now. >_>
@bluepants8140
@bluepants8140 Жыл бұрын
@@wasserruebenvergilbungsvirus I am have a problem about at that time where my numbers are not showing up
@arif2336
@arif2336 Жыл бұрын
@@bluepants8140 Did you figure it out?
@bluepants8140
@bluepants8140 Жыл бұрын
@@arif2336 Nope
@holyage3128
@holyage3128 2 жыл бұрын
Thank you a lot. I haven't met such a high quality content about practical JS on KZfaq. Keep it up!
@_werther
@_werther 2 жыл бұрын
Beautifuly done, im learning a lot with your javascript projects, even the 'old' ones! Thanks man, you're great
@pramodreddypandiri194
@pramodreddypandiri194 Жыл бұрын
I am getting this error "deleteButton.addEventListener is not a function" please help
@HostDotPromo
@HostDotPromo 5 жыл бұрын
This is awesome, seems like you can build everything with javascript these days 🔥
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
You really can. JavaScript has become increasingly useful and powerful over the years.
@kaifrabi5244
@kaifrabi5244 4 жыл бұрын
@@c.sch.6101 world*
@winterdaisy5610
@winterdaisy5610 4 жыл бұрын
@@c.sch.6101 lol
@appleshoes1419
@appleshoes1419 4 жыл бұрын
@@kaifrabi5244 *designed to work and not to feel
@luxtenebris764
@luxtenebris764 4 жыл бұрын
@@WebDevSimplified embedded systems
@alexzahrai4703
@alexzahrai4703 3 жыл бұрын
Dude, such an informative and easy to follow tutorial. Thank you!
@dazamora
@dazamora 4 жыл бұрын
hey I learning to code, since 2 months and i saw a lot of calculators, and I think yours are the most efficient, well done and most nice of all of them, incredible job, I miss some concepts, but just for my lack of experience. Thanks again, you have a new subscriber
@EpiDot52
@EpiDot52 4 жыл бұрын
Really enjoyed walking through this. Tried to work things out before watching the video but I was way off. I understood your explanations so hopefully that means I learned something! I'm going to look for other similar walkthroughs you've made.
@tonyli9098
@tonyli9098 4 жыл бұрын
Thank you so much. I've learned a little more about CSS and programming style. You're a real good teacher.
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
That is awesome! I'm really glad my videos are able to help.
@MVIVN
@MVIVN Жыл бұрын
I'm just sitting here watching this in disbelief and feeling utterly useless and defeated. I have spent the past 3 days trying to make a JavaScript calculator and I could only get it partially working, but couldn't work out how to make it do several things, and each time I tried to solve those problems the calculator got worse (more things broken, more errors, stopped working) and I've accepted that despite all my learning efforts I'm just not good enough to do a project like this yet. I've been learning Javascript on and off for 5 months so far, and admittedly that's not a very long time, but I thought I was far enough along my journey to complete this calculator assignment. This video has humbled me and shown me that I'm completely and utterly useless at the moment. Gonna need several years of learning to be able to make an entire calculator as quickly and perfectly as it was done in this video.
@ayushsoni5050
@ayushsoni5050 Жыл бұрын
Don't feel defeated. Everyone's learning capabilities are different and the guy you are watching has years of experience at Javascript and programming in general. Break the problem down, write it down if it helps, and take it slow and you'll be able to solve it.
@MVIVN
@MVIVN Жыл бұрын
@@ayushsoni5050 Thank you, I appreciate your supportive words a lot. It's really difficult sometimes because I started my coding journey late (I am already in my 30s) in the hopes of maybe unlocking some better career opportunities in the future for my family's benefit, so when I make a lot of effort and still fail I start to get really down on myself and think that maybe I'm just not cut out for this type of stuff. I will try to keep things in perspective and try not to rush through things, just one step at a time and keep learning something new every day.
@moritz759
@moritz759 Ай бұрын
How is it going?
@agraiskr
@agraiskr 2 жыл бұрын
i think this is the best of the calculator samples i have found on youtube ,Thank you!
@geoffreyleatham8827
@geoffreyleatham8827 9 ай бұрын
This is the first video of yours that I have watched and you've earned my sub. Javascript isn't my first or even second language so I came into this video expecting to skip around to grab a few snippets of code as syntax examples but I ended up coding along with the video. I know this video is a few years old but keep up the great work!
@ankitagarwal4914
@ankitagarwal4914 4 жыл бұрын
Really Awesome tutorial!!. So much functionality in just 38 mins ...This is by far the best and complete Calculator tutorial..
@ahmmadawshaf
@ahmmadawshaf 3 жыл бұрын
Awesome tutorial to practice JS in web design for beginners! Thank you so much!
@atsglobalservices6136
@atsglobalservices6136 Жыл бұрын
Wonderful tutorial. I began learning javascript in June 2022, and I'm glad I was able to create this calculator in a timely manner to suit my thought process.
@nicopicco
@nicopicco 3 жыл бұрын
Kyle, thank you so much, I was able to refactor my css quite a bit with this information.
@deadgvrl
@deadgvrl 4 жыл бұрын
I know I'm late but holy crap dude, thank you so much. You've been a massive help
@biniyamhaile5298
@biniyamhaile5298 Жыл бұрын
The channel really deserves it's name. "Web Dev Simplified"!
@faqeehtv4502
@faqeehtv4502 Жыл бұрын
Great tutorial!! Loved every bit of it. Easy to understand and great concepts as well.
@pahkah.1398
@pahkah.1398 4 жыл бұрын
Alot of coding but ive mostly been doing HTML and CSS which ive enjoyed alot. But now im putting my feet in the JavaScript waters and i can say its alot atm but ima keep practicing to get better! Wish me luck!
@cosme2441
@cosme2441 3 жыл бұрын
Really appreciate this video. I am at a point where I've studied JavaScript plenty and would like to start applying it. I know that I am not the first to struggle with this transition and I am grateful to have access to this type of content especially for free. Thank you for patiently explaining each steps in a precise and concise manner. Also any advice for someone in my situation would be greatly appreciated!
@pramodreddypandiri194
@pramodreddypandiri194 Жыл бұрын
I am getting this error "deleteButton.addEventListener is not a function" please help
@cosme2441
@cosme2441 Жыл бұрын
@@pramodreddypandiri194 This usually happens when you are missing the definition for a function. Hard to fix errors without seeing the code. Maybe you mispelled the name of the function when you defined it. You define the function like function name() {} or store it in a variable like this const name = () => {}. But basically look for your function deleteButton and make you spelled it correctly. If not go Stackoverflow your new best friend :).
@ygaaaoo
@ygaaaoo Жыл бұрын
@@cosme2441 hey bro, in 2 years ago you said this "I am at a point where I've studied JavaScript plenty and would like to start applying it. I know that I am not the first to struggle with this transition" and now I'm in the same position.. how are you going with javascript today ?? you are already working in a company or something ?? thanks.
@ygaaaoo
@ygaaaoo Жыл бұрын
@@cosme2441 I think you are a good programmer now
@cosme2441
@cosme2441 Жыл бұрын
@@ygaaaoo Hey hey, I am currently making a living of working as a freelancer. It's not yet that tech money but good enough I don't have a side job. Currently working on a few projects. My advice, don't stress so much about how good you are. Just start building and study specific things as you need them when running into problems. My experience is concepts are a lot easier to learn, when you need to apply them. Also don't give up, enjoy the process and give yourself a break when you get super stuck! But struggle a little first.
@stephanies.6033
@stephanies.6033 3 жыл бұрын
I've watched so many different videos showing me how to follow along many different projects and none of them made sense until i clicked on yours. you actually go step by step showing how its done and i really appreciate it thank you so much!!
@JazzDaniels
@JazzDaniels 2 жыл бұрын
I have watched many JS build calculator videos, and this is definitely one of them.
@kayleecho3861
@kayleecho3861 5 жыл бұрын
Thank you so SO much! This helped me a lot.
@PixelNomadAdventures
@PixelNomadAdventures 2 жыл бұрын
Kyle, thank you so much for creating this video. I would find it more helpful if you set the html title of the calculator you are working on with us to something along the lines of "New Calculator". This way the viewers can see in the tab if you are demonstrating with the finished calculator, or the one that you are creating. Hope this makes sense. Thank you
@machfiver753
@machfiver753 2 жыл бұрын
Nice tutorial. I like the speed you go at and how you don't go off on tangents or over explain everything. I can see how you can use this program for something else by tweaking the elements to do whatever it is another program might do. Like a calendar for instance
@MimcheIshak
@MimcheIshak Жыл бұрын
I ran when I first saw this video last year. Guess what !, I came back stronger💪 I used almost 4 hours to implement mine(mimick) Thank you web dev simplified
@LinkChenTW
@LinkChenTW 4 жыл бұрын
AWESOME!!! Very practical tutorial and easy to understand. hope to see more tutorials like this.
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
Thank you. There are a ton more tutorials just like this one on my channel to checkout and plenty more coming.
@flaviamiranda9811
@flaviamiranda9811 2 жыл бұрын
Thank you for the video, normally we wouldn't find a calculator project using JS classes as I consider this to not be a complete beginner topic, and normally a calculator is a begginer friendly project in theory - but it's so good that you provided us with this alternative. However, since this is not the easiest topic in the world may be slowing things down a bit would help - I found myself having to change the video speed to 0.75 sometimes because when I was still trying to process one thing you did you were already 2 or 3 steps away from where I was. I understand that without that the video might have been too long but I guess better a longer video than one it's hard to follow 😅
@pramodreddypandiri194
@pramodreddypandiri194 Жыл бұрын
I am getting this error "deleteButton.addEventListener is not a function" please help
@ejiroabohwo6801
@ejiroabohwo6801 Жыл бұрын
It is meant to be button.addeventlistener
@kelvinmburu2698
@kelvinmburu2698 Жыл бұрын
Thanks for this tutorial. I just started out on javascript a few weeks ago and I have enjoyed your method of teaching.
@liztowoju7464
@liztowoju7464 2 жыл бұрын
Thank you very much for this very good tutorial. I am excited to try out the other beginner friendly projects on your channel.
@mvvkiran
@mvvkiran 3 жыл бұрын
Damn brilliant the way you just plough through the code and add it on the fly in a precise sequential manner. Kudos!!
@vasilemidrigan50
@vasilemidrigan50 2 жыл бұрын
On the fly? Don't think so. rather there's more work than we think, making videos like this takes some time and dedication, and of course a lot of hard work behind the scenes.
@peaklegacy146
@peaklegacy146 Жыл бұрын
I am brand new to JS and this helped me a TON. I couldn't get an understanding as to how JS worked at all so I decided just to follow along with a project. After almost 4 hours of following along and debugging my mistakes I finally finished! This definitely helped me build a foundation in JavaScript.
@21Dimen
@21Dimen Жыл бұрын
You learned in 4 hours is what you're saying ? :)))
@mohammadqudratullahbhuyan8262
@mohammadqudratullahbhuyan8262 Жыл бұрын
Wait are you saying it took you 4 hour to follow THIS guy and make a calculator
@jashgudhka2660
@jashgudhka2660 9 ай бұрын
How were you not stuck after 20mins. I can't get the output on the display@@21Dimen
@techwithdanyal4798
@techwithdanyal4798 3 жыл бұрын
Oh man you are awesome, I enjoyed a lot while watching your tutorials.
@7kakan
@7kakan 3 жыл бұрын
Began coding for real a week ago (have done some simple coding via iPad earlier). During this project, I learned how to (relatively) effectively find my JS errors through inspect element. More often than not, I also found that the most effective way to correct an error is to rewrite the entire strip of code where the error was found. I got the calculator to do the calculations, but have not yet got the AC or DEL buttons to work properly
@alexluthor9066
@alexluthor9066 3 жыл бұрын
At 21:15 when I click on buttons nothing shows in the output. I really don't know what I'm doing wrong.
@kamyarathod5702
@kamyarathod5702 3 жыл бұрын
i encountered the same problem.
@sean2277
@sean2277 3 жыл бұрын
any leads on how you rectified it
@benjipixel1438
@benjipixel1438 3 жыл бұрын
same needs help.
@druggero77
@druggero77 5 жыл бұрын
Outstanding tutorial! Thank you.
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
You're welcome
@jaydenmoon1165
@jaydenmoon1165 2 жыл бұрын
I created a calc with no classes - it was a mess - lol but I was very happy that I had most of the same code and capabilities - I am working on writing cleaner code - this video was fun to watch - thank you!
@iconoclast281
@iconoclast281 4 жыл бұрын
Great project, im new to JavaScript. I 'borrowed' your user interface design and then implemented the logic using React js state/setStates and it's finally working. Next step is to make it mobile responsive then will add it to my portfolio and github.
@ibuzz2544
@ibuzz2544 2 жыл бұрын
I have a question, why do you use switch between (for example), "currentOperand" and "currentOperandTextElement" instead of just using "currentOperandTextElement" in every place that uses "currentOperand" or vice versa? From what I noticed you made a variable called "currentOperandTextElement," and that included every operation so why not use that throughout the whole code? I hope my question makes sense.
@cosmelvillalobos6448
@cosmelvillalobos6448 3 жыл бұрын
hey, man awesome video! I was able to build my calculator as well following your method and added several more function, like factorial, exponential and square root all applying the principles I learned from your video, thanks a lot!
@kevogithua8012
@kevogithua8012 Жыл бұрын
Thanks a lot! This is still one of the best tutorials after completing the beginner level
@BillionaireBelief
@BillionaireBelief 3 жыл бұрын
Thanks for the tut! It helped me realize I have a long way to go with javascript
@Kyle-rf5mb
@Kyle-rf5mb Жыл бұрын
From one Kyle to another, can you give advice on how you set out to tackle a problem given to you? I know this is probably a easy problem for even a junior programmer. I started fine with a good plan but then i soon came into problems and realised my plan wasn't going to work. I had a switch statement going on for the operators and some other stuff but it just got too messy which brought me here.
@NoudvD63
@NoudvD63 4 жыл бұрын
Correct me if I'm wrong. To get a data attribute through the dataset object, get the property by the part of the attribute name after data- . Then it is converted to camelCase. In this case the data-current-operand attribute in the HTML file is converted to currentOperand. This is how JS reads values from data attributes.
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
That is exactly correct.
@djkentuckyham
@djkentuckyham 4 жыл бұрын
@NoudvD63 Thanks for asking that. I'm new to JScript and had the same question.
@korkmazmerve
@korkmazmerve Жыл бұрын
this is amazing i learned a lot of stuff. i am a begginer so i watch a lot of tutorial like this and i can definetly say that this video is one of the best video i've ever seen. thanks for sharing you made this complicated calculator functions (at least complecated for me ) very easy to understand.
@sghaiermohamedyassine6500
@sghaiermohamedyassine6500 Жыл бұрын
I had a teacher who gave us an exercise to create a calculator in the class. That was frustrating because it was hard to make it in one hour and this discourage me to learn development.😵 But when you see this good man who is explaining how to do it, you will love programming.👨‍🏫
@gambit3904
@gambit3904 4 жыл бұрын
I made your 40 min video last about 2 hours from taking notes and trying to absorb the concept, instead of just code-along, and it was a very very helpful experience. Than you so much! One piece of advice: maybe make the background-color on the calculator being constructed in a different tone! Sometimes I got a scare from seeing advance functions in the finished one, but thinking it was the under construction. Of course, not on this video, but on future ones (looking forward to them!) again, thanks!
@lost2024
@lost2024 Жыл бұрын
Hey bruh will it be possible for you to share me the notes you've made?!! it'll be so nice of you if you can...
@ABDTalk1
@ABDTalk1 Жыл бұрын
@@lost2024 did you just refer to him as "bruh"
@njohnsalisbury2515
@njohnsalisbury2515 5 жыл бұрын
Just gotta say, I absolutely love the slide over you do with your finger to the preview of the calculator!
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
Thanks. I like experimenting with fun intros because educational videos can get really dry and boring to watch.
@sphereman3572
@sphereman3572 7 ай бұрын
dude that slide in at the start was clean
@vasilemidrigan50
@vasilemidrigan50 2 жыл бұрын
Kyle, thank you very much for this awesome mini-tutorial!
@yumpiri
@yumpiri 3 жыл бұрын
This is so overwhelming 🤯
@KapilMaharjantractorspareparts
@KapilMaharjantractorspareparts 2 жыл бұрын
We have to have strong fundamentals. Be toughest 💪
@brownboyintokyo7368
@brownboyintokyo7368 3 жыл бұрын
Might be a beginner project but the level of functionality is definitely high level!! I understand what’s going on but I need to practice more in order to develop this level of thinking!! Thank you for uploading it mate!🙏 Just wondering like how long did it take u to develop this level thinking 🤔?
@westernpigeon
@westernpigeon 2 жыл бұрын
this is not a beginners project. someone who just just starting to learn JS would not understand this at all.
@andrei9115
@andrei9115 2 жыл бұрын
@@westernpigeon Good job for this guy but I think he should use other names as the constructor's variable because when you have something like this.x =x x x this.x, you won't get a clue! I pretty much understood everything to the point when he put "this.operation" as undefined. I didn't get that. Maybe he made that assignment in order to use it later as a condition but I am not sure. Also, the last part was not so easy to understand. A very good and mind-blowing project all in one! Good job!!
@softwareacademyng
@softwareacademyng Жыл бұрын
@@westernpigeon I was about saying the same thing, the functionality and the concept is too advanced for a beginner. This is a real life calculator and for learning.
@kasmeneyes2227
@kasmeneyes2227 3 жыл бұрын
You make it look so easy, fascinating to watch
@bugshavefeelerstoo
@bugshavefeelerstoo Жыл бұрын
Love this format dude, instant sub. Working my way towards web3 and reactjs for a communtiy project on the harmony blokchain.
@benjipixel1438
@benjipixel1438 3 жыл бұрын
For those who ran into the same problem as me, and couldn't get their buttons to be nice nd square: In the CSS file, under the: .calculator-gird > button put in: height: 100px; If this doesn't work, then play around with the height until it does. Hope this helps!
@Sqeedys
@Sqeedys 3 жыл бұрын
still doesn't work :(
@crf9235
@crf9235 3 жыл бұрын
@@Sqeedys add as he said : height 100px plus a witdh 100px and then in the .span-two witdh: 200px;
@teedingwei1796
@teedingwei1796 2 жыл бұрын
try this .calculator-grid { align-content: center }
@rodwinpieterse1950
@rodwinpieterse1950 3 жыл бұрын
Kyle you should seriously consider making courses (if you haven't yet). You have a gift for explaining in minutes things I couldn't grasp in hour(s)
@arcosd63
@arcosd63 Жыл бұрын
Fun project Kyle, thank you! I didn't know it was so simple to create a calculator
@minheekim7126
@minheekim7126 2 жыл бұрын
21:11 For anyone getting stuck here bc you don't see your number showing up: 1) go to index.html file 2) find the
@pareekshithachar3788
@pareekshithachar3788 2 жыл бұрын
idk if that was a typo, but its defer inside the script tag and not "deter", should work now
@minheekim7126
@minheekim7126 2 жыл бұрын
@@pareekshithachar3788 Thanks so much!! XD
@jashgudhka2660
@jashgudhka2660 9 ай бұрын
Did it, still face the same issue, google isn't helping me with the error either. I tried to console log the button inside the event listener and it gave me this: : : : Uncaught TypeError: Cannot set properties of undefined (setting 'innerText') at Calculator.updateDisplay (script.js:32:46) at HTMLButtonElement. (script.js:57:16)
@bethl3381
@bethl3381 3 жыл бұрын
Thank you Web Dev Simplified. This is a great tutorial.
@stephenaraka5870
@stephenaraka5870 4 жыл бұрын
Thank you so much for the well explained video. You helped me understand a lot of concepts here.
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
I'm really glad I could help.
@blink182lives100
@blink182lives100 3 жыл бұрын
22:03 I had to use and if else statement because I was getting an error for trying to use the .toString() method when this.currentOperand was undefined. I am unsure of why the person who made this video does not get this error and I did but yea in case anyone else encounters the same issue if(this.currentOperand===undefined) { this.currentOperand=number } else{ this.currentOperand=this.currentOperand.toString() + number.toString() }
@hariprasadanand7779
@hariprasadanand7779 3 жыл бұрын
Ya I also had same problem
@jahallb1
@jahallb1 3 жыл бұрын
Thank you for the fix!
@vlad-zf1ev
@vlad-zf1ev 3 жыл бұрын
Ya I also had same problem. it's a mystery to me why the author has no problem (Undefuned.toString() Problem!!) my code is better, it is on point click. will add 0. appendNumber(number){ if(this.currentOperand === undefined){ this.currentOperand = number; } else if (number === '.' && this.currentOperand.includes('.')){ return } else if (this.currentOperand === '.') { return this.currentOperand = '0.'+ number } else { this.currentOperand = this.currentOperand.toString() + number.toString() }
@albertoast
@albertoast 2 жыл бұрын
Thank you for the fix!
@ZeFrancisc0
@ZeFrancisc0 Жыл бұрын
had the same problem, thanks for the fix mate!
@JordanThiessen
@JordanThiessen 3 жыл бұрын
I like your channel, because you actually talk and explain it.
@girlingame518
@girlingame518 3 жыл бұрын
so useful , finally i saw classes used in tutorial
@christiananderson4001
@christiananderson4001 3 жыл бұрын
Really enjoyed the tutorial. Anyone who watched this though and wants to take it a step further, once the user gets a result (i.e. 50+50=100) they can still hit delete to remove digits from the result (100 -> 10 -> 1). Would be good practice fixing this issue.
@21Kip
@21Kip 2 жыл бұрын
Moreover, you can just keep typing "answer"
@GH4L
@GH4L 5 жыл бұрын
great video (as usual) i have a question: where does 'currentOperand' from 'this.currentOperand' come from? i never saw you initialize/create it
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
In javascript you do not need to initialize a variable on an object. If you do not set a variable on an object it will default to undefined.
@robinware77
@robinware77 4 жыл бұрын
I had the same thought when I was watching the video. He created it to store the incoming values. By saying this.currentOperand he essentially initialized it there. It was an empty variable to be used later.
@TheHilarioushuman
@TheHilarioushuman 3 жыл бұрын
Loved this tutorial. Helped me a lot!
@jedt3d
@jedt3d Жыл бұрын
Thank you very much! I've learn something new again.
@sansvlr
@sansvlr 2 жыл бұрын
The first time I saw this, it was very difficult for me to understand, and I went back to learning the basics, various methods and OOP in 1 week, and actually this code is clean and easy to read.
@jerarldlorica1151
@jerarldlorica1151 Жыл бұрын
Can you share what basics And methods you back to learn
@TopRock-vn4ni
@TopRock-vn4ni 2 жыл бұрын
Very good tutorial! Im still a begnner and followed step by step and it worked perfectly. The only issue I have is when I type many numbers in the calculator, they get out of the calculator. But overall thanks a lot! :D
@ericobiomah5235
@ericobiomah5235 2 жыл бұрын
Use word-break on your output div in your CSS just as he showed in the tutorial and your numbers will move onto the next line.
@patrickagoptimedia9799
@patrickagoptimedia9799 2 жыл бұрын
This is an excellent step-by-step tutorial.
@JekabsJan
@JekabsJan 2 жыл бұрын
Everybody gansta till it's time for JS
@vlaxi8787
@vlaxi8787 5 жыл бұрын
Thanks for this. The JS part seems quite challenging indeed but it'll help for sure!
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
It definitely has some tricky parts, but these sections are great at teaching many important concepts.
@vlaxi8787
@vlaxi8787 5 жыл бұрын
@@WebDevSimplified I don't really understand when to use Classes (OOP) - how do you decide when to use them?
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
I generally use them when I have a set of data that needs to be contained and interacted with in many ways. Classes are just convenient ways to contain and manipulate data.
@vlaxi8787
@vlaxi8787 5 жыл бұрын
@@WebDevSimplified Thanks a lot!
@IDBStudios
@IDBStudios Жыл бұрын
Wow! This is awesome. I got stuck while trying to build a calculator with vanilla JavaScript. But this video is a very good one.
@newweeks7250
@newweeks7250 2 жыл бұрын
Superb You are the simplest tutor I ever seen. Thank you so much for your videos :)
@lesalmin
@lesalmin 3 жыл бұрын
"All we need to do is create some files". Web dev simplified indeed ;-)
@jfjf2995
@jfjf2995 2 жыл бұрын
😂
@GenetetIncorporated
@GenetetIncorporated Жыл бұрын
I've had to wait 33 years to find out that AC stands for All Clear ^^
@mackynikat8833
@mackynikat8833 3 жыл бұрын
. sir kyle will sure be with the creator of codes for sure . hes so obidient following each of definitions that i encountered so far . salute to this my man here !
@ceydaaleynaaltun5860
@ceydaaleynaaltun5860 5 ай бұрын
Thank you Kyle, great video!
@josemaribautista7552
@josemaribautista7552 4 жыл бұрын
when did he create currentOperand and previousOperand variables? I dont see it anywhere
@benfichter5351
@benfichter5351 3 жыл бұрын
At the very beginning. Go to 0:00 and just watch for like 2-3 mins. You should find it
@Rainbowstunting
@Rainbowstunting 3 жыл бұрын
@@benfichter5351 those are the classes of the divs you're talking about (current-operand and not currentOperand), he's asking about the variables that appear out of 'nowhere' at 18:51. Good explanation can be found in another comment here (comment chain starting with the comment of shubham).
@streetboy5721
@streetboy5721 3 жыл бұрын
I don't understand either, how these currentOperand and previousOperand works!
@radu6772
@radu6772 3 жыл бұрын
He created them in the clear() function
@unscripted483
@unscripted483 3 жыл бұрын
in the constructor
How To Build JavaScript Projects Without Getting Stuck
32:57
Web Dev Simplified
Рет қаралды 70 М.
Build this JS calculator in 15 minutes! 🖩
15:20
Bro Code
Рет қаралды 365 М.
Они убрались очень быстро!
00:40
Аришнев
Рет қаралды 2,3 МЛН
ELE QUEBROU A TAÇA DE FUTEBOL
00:45
Matheus Kriwat
Рет қаралды 35 МЛН
Omega Boy Past 3 #funny #viral #comedy
00:22
CRAZY GREAPA
Рет қаралды 36 МЛН
Learn DOM Manipulation In 18 Minutes
18:37
Web Dev Simplified
Рет қаралды 1 МЛН
JavaScript Classes Tutorial
1:01:29
freeCodeCamp.org
Рет қаралды 282 М.
Build A Clock With JavaScript
17:43
Web Dev Simplified
Рет қаралды 358 М.
JWT Authentication Tutorial - Node.js
27:36
Web Dev Simplified
Рет қаралды 1 МЛН
Create a Responsive Calculator in HTML CSS & JavaScript
12:43
CodingLab
Рет қаралды 72 М.
how to build a simple calculator using javascript
27:22
Ranjan-Beginner's Guide
Рет қаралды 77 М.
Node.js Passport Login System Tutorial
36:28
Web Dev Simplified
Рет қаралды 1 МЛН
Build Real Time Face Detection With JavaScript
12:41
Web Dev Simplified
Рет қаралды 1,3 МЛН
Они убрались очень быстро!
00:40
Аришнев
Рет қаралды 2,3 МЛН