Create a Scientific Calculator With JavaScript, HTML and CSS | JavaScript Project For Beginners

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • @Code Explained Says Hi!
    Today we're going to create a fully working Scientific Calculator App with Vanilla JavaScript and HTML.
    This a beginners tutorial, And I'm going to discuss the logic behind every line of code first, then once you're ready and fully understand what we're going to do, then we can open our text editors,
    What you're going to learn in this tutorial:
    * How to select an HTML element in JavaScript using querySelector method.
    * How a forEach method works.
    * Modulo operator %
    * Click event, and the target property to target a click element.
    * Select The last element using querySelector method.
    * JavaScript replace method.
    * JavaScript unshift method.
    * Create the factorial function in JavaScript.
    * Gamma function in JavaScript.
    * Handle angle units (radian and degrees) in JavaScript.
    * Trigonometric and Inverse trigonometric functions in JavaScript.
    * The Array pop and push methods.
    * JavaScript Errors - Throw and Try to Catch
    -----------------------------------------------------------------------------------------------------
    | LINKS |
    -----------------------------------------------------------------------------------------------------
    DOWNLOAD SOURCE CODE + STARTER TEMPLATE:
    github.com/Cod...
    🌍 Social Media Links.
    ◾ Facebook : / code.explained.official
    ◾ Twitter : / code_explained
    ◾ Instagram : / code.explained.official
    ◾ GitHub : github.com/Cod...
    💲 Suppport the Channel
    Paypal : paypal.me/Code...
    Buy Me a Coffee: www.buymeacoff...

Комментарии • 112

  • @CodeExplained
    @CodeExplained  3 года назад +1

    🚨 Big Announcement! 🚨
    Hey everyone! I've made a big decision for this channel-I've turned off ads on all my videos! That's right, you can now enjoy all my content ad-free! This means I'm earning $0 from ad revenue, but I believe this is the right move to make your viewing experience better.
    If you find my content valuable and want to support my work, there are several ways you can help:
    Like & Share: Simply liking the video and sharing it with friends helps a lot!
    Subscribe & Hit the Bell: Stay updated and never miss a new video.
    RUclips Thanks: Use the "Thanks" button below to send a one-time donation.
    Join the Channel Community: Get exclusive perks and behind-the-scenes content.
    Buy Me a Coffee: buymeacoffee.com/CodeExplained
    PayPal Donation: www.paypal.com/paypalme/CodeExplained
    Every little bit counts and goes directly to creating more high-quality content for you all. Thank you so much for your continued support!
    Let’s keep growing and learning together! 🌟

  • @areebmurad813
    @areebmurad813 4 года назад +8

    Bro your efforts and way of teaching are commendable. Keep doing what you are doing and keep teaching us like this.

    • @CodeExplained
      @CodeExplained  3 года назад +1

      I'm so glad to hear this from you, thanks a lot 💖

  • @DanielSacramento78
    @DanielSacramento78 3 года назад +2

    You have the best videos in the internet. Your way of teaching are amazing. Im from Brazil and I prefer to learn with u then with my teachers. Keep going! U rock!

  • @Pak6tani
    @Pak6tani 2 месяца назад

    Wow so nice sir you are King of the lectures sir you are my last favo teacher
    I love you

  • @Mauna25
    @Mauna25 3 года назад +3

    Amazing tut man, keep it up! Everything it's so well explained, LOVE IT!

  • @shrutikagawas4916
    @shrutikagawas4916 3 года назад +1

    I have become a huge fan of yours now. Damn the Explanation was sooo good it was so easy to understand the concepts..... I'm gonna always follow your work for some great inspiration and boost my motto. Thanks alot for making such a detailed Video on such projects

  • @user-uc9gi2xf8r
    @user-uc9gi2xf8r Год назад +1

    What a pleasure. Thank you for such informative, educational content!

  • @vijayd5551
    @vijayd5551 2 года назад

    I tried with some repeat watch on this scientific calculator video.. it worked well for me.. really appreciate the efforts.. keep up your contribution..

    • @CodeExplained
      @CodeExplained  2 года назад

      Great job! glad it was helpful, and you're welcome!
      Again thanks for your support!

  • @kushagra4586
    @kushagra4586 3 года назад +1

    If i could give infinite number of likes to this video I would keep on tapping the like button ..... thanks a lot man!!!!
    🙏🙏

  • @hafizjavaid
    @hafizjavaid 4 года назад +2

    Very informative and well explained. I will be waiting for your next video

    • @CodeExplained
      @CodeExplained  3 года назад +1

      I'm so glad to hear this from you, thanks a lot 💖

  • @Tito-ye3ur
    @Tito-ye3ur 4 года назад +1

    Grate video! For a future video could you teach us how to make a clock? You're my favorite JS instructor on youtube.

    • @CodeExplained
      @CodeExplained  3 года назад

      I'm so glad to hear this from you, thanks a lot 💖
      I will try to

  • @VikasSingh-pw5iz
    @VikasSingh-pw5iz 3 года назад +2

    Really awesome, please make an advance Login page using Nodejs , express and mysql.

    • @CodeExplained
      @CodeExplained  3 года назад

      Happy to hear that, thanks 💖 I will

  • @valmiralmeida4802
    @valmiralmeida4802 4 года назад +6

    Please enter the complete code, I have a problem and I can't solve it. I'm Brazilian and I don't understand English well

    • @kushagra4586
      @kushagra4586 3 года назад +5

      I have completed the tutorial and finished the code....if u want me to share it then i can😊😊

    • @valmiralmeida4802
      @valmiralmeida4802 3 года назад

      @@kushagra4586 would be great. My discord Valmir#7065, in case you want to add me and send there

    • @stricklybisnez3296
      @stricklybisnez3296 3 года назад

      @@kushagra4586 please! I started this project but its hard to follow along because he does not explain in code hes talking and completely ignoring things some beginners are unfamiliar with

    • @stricklybisnez3296
      @stricklybisnez3296 3 года назад

      strikclybisnez@gmail.com

    • @CodeExplained
      @CodeExplained  3 года назад

      Check the repo on github, link is in the description?

  • @johnadriandodge
    @johnadriandodge 2 года назад

    Shalom howdy morning how. You did an amazing job with this.
    I would like to extend this to have a matrix (linear) algebra and calculus mode, a graphing window to graph equations, a conversion mode (volume, length, weight/mass, temperature and currency), similar to the magnificent windows calculator. By the way, they have allowed this to be open source and published the code upon Github to the best of my knowledge. I have not be able to build it out in Visual Studio yet. In any case, you did an amazing job with this, your teaching style is great, and you have a very calming demeanor. Thank you for sharing!

  • @mvrdara
    @mvrdara 4 года назад +2

    Awesome 👌

  • @SarthakGamer
    @SarthakGamer 3 года назад

    this channel is amazing

  • @supratiksarkar1195
    @supratiksarkar1195 Год назад

    i am trying for the whole day, still scientific calculator is very very tough for me as a javascript beginner (first 5 days). Specially the first bracket is tough. I have first found out the index of all the operators but facing problem due to the bracket thing.

  • @TechnoDB
    @TechnoDB 4 года назад +2

    Nice, codeExplained.
    If you can, make project videos on React in this way. It's really effective. :)

  • @bigvlogger2940
    @bigvlogger2940 4 года назад +2

    Thank you so much for this video.
    Any ways we can donate for you to make such video going

    • @CodeExplained
      @CodeExplained  3 года назад

      I'm so glad to hear this from you, thanks a lot 💖
      Any support will be appreciated.

  • @kissmonica9071
    @kissmonica9071 3 года назад

    Yes, for deg, cos(180) is -1 but if you put cos(90) it returns 6.123233995736766e-17 instead of 0.

    • @CodeExplained
      @CodeExplained  3 года назад

      I checked it and it works just fine.

  • @pondokkoding5023
    @pondokkoding5023 10 месяцев назад

    Amazing

  • @ameera3096
    @ameera3096 2 года назад

    can you send the full code, i tried setting it up the exact same way and my buttons are not working

  • @sgcreation2309
    @sgcreation2309 2 года назад

    hello , I was trying to get it by but still I get an error so can you please share final version of the code

  • @meetvardoriya2550
    @meetvardoriya2550 3 года назад +1

    Here is the entire code of the project,with few modifications ↓
    repo link ===> github.com/mv1249/ScientificCalculator

  • @loosethread8754
    @loosethread8754 Год назад

    Hi i just started this and isnt POWER easily solved in ES6 by just using ** ?

  • @trangnguyenthibaotrang6944
    @trangnguyenthibaotrang6944 4 года назад +1

    Thank you so much

  • @kushagra4586
    @kushagra4586 4 года назад +1

    Can u please teach us how to make Chess using JS .It will be really helpful.thanks.

  • @mirsajadhashemi
    @mirsajadhashemi 2 года назад

    Hi, thank you. Have you saved or uploaded these codes?

  • @samehamer.
    @samehamer. 11 месяцев назад

    شكرا جزيلا

  • @kishanbeladiya4649
    @kishanbeladiya4649 3 года назад +2

    Please give me complete code. Because I am facing some difficulty on your GitHub code. Please give me complete code.

    • @meetvardoriya2550
      @meetvardoriya2550 3 года назад +2

      fork from my repo,i made the same calculator with additional changes too!!
      my repo === > github.com/mv1249/ScientificCalculator

    • @CodeExplained
      @CodeExplained  3 года назад

      Did you get the source code yet or not?

    • @kishanbeladiya4649
      @kishanbeladiya4649 3 года назад

      @@CodeExplained yes, I got it

    • @edutecharena8323
      @edutecharena8323 2 года назад

      @@CodeExplained pls no

  • @rafaelapascoal7874
    @rafaelapascoal7874 2 года назад

    i cant get this part to work and cant figure out why
    const row = document.querySelector(".row:last-child");
    row.innerHTML +='
    ${buttons.symbol}
    ';
    added_buttons++;
    it keeps on showing this error msg : Unterminated string literal.

    • @yomaata727
      @yomaata727 2 года назад

      hi, i used a foraward slash - \ - at the end of the line before indenting so it could stop showing the error. Hope that helps.
      ' \
      ${button.symbol} \
      ';

  • @forderdrek8757
    @forderdrek8757 2 года назад

    Actually there's a mistake with the factorial. when it's {number}!!! it's a Triple factorial not three factorials after one another. It would be a simple fix but this might make a HUGE mistakes in answers.
    Triple factorial:
    With factorial you go down by 1 each time, with triple factorial you go down by 3 instead. there is also double factorial, quadruple factorial, exc.
    Definition:
    n!!! = n * (n-3)!!!
    ( single factorial: n! = n * (n-1)! )
    Examples:
    5!!! = 5 * (5-3) = 10
    7!!! = 7 * (7-3) * (7-3-3) = 28
    10!!! = 10 * (10-3) * (10-3-3) * (10-3-3-3) = 280

  • @omoruyipeace1069
    @omoruyipeace1069 Год назад

    What if I want to make this mobile responsive

  • @Pak6tani
    @Pak6tani 2 месяца назад

    Sir I not know completely English I have this larg problem anyway I love you I know Urdu Hindi languages

  • @anasfarooq9013
    @anasfarooq9013 6 месяцев назад

    can you please help me how to responsive this

  • @user-tq6fx7tl7e
    @user-tq6fx7tl7e Год назад

    Can you do an algebra calculator?

  • @edutecharena8323
    @edutecharena8323 2 года назад

    Good tutorial but sir i dont understand English well so can you give me full source code am having issues

  • @aeronfiloteo8772
    @aeronfiloteo8772 2 года назад

    The code is incomplete in github sir..thanks

  • @johnnsikak6510
    @johnnsikak6510 3 года назад +1

    please how can i get the source code ?

    • @CodeExplained
      @CodeExplained  3 года назад

      check the repo on github, link in the description.

  • @fishmarkholmes1834
    @fishmarkholmes1834 3 года назад

    Please , We need you to come back 😢🙏🏻

  • @aaronargottelopez3488
    @aaronargottelopez3488 3 года назад

    Thank you

  • @kaksha17
    @kaksha17 2 года назад

    Hey! Could you please let me know if I can reuse this code?

    • @CodeExplained
      @CodeExplained  2 года назад

      Yeah you're free to use the code, and it would be great if you can mention the channel if that's possible!

  • @gojjamenegeseyoutub709
    @gojjamenegeseyoutub709 3 года назад

    variy naise lerning system

  • @ImranKhan-kf4ez
    @ImranKhan-kf4ez Год назад

    github code is error

  • @kissmonica9071
    @kissmonica9071 3 года назад

    why adding rows in the function that creates buttons is not working for me? ```butoane_calc.forEach( button => {
    if (added_btns%8 == 0) {
    input_element.innerHTML += ``;
    }```

    • @CodeExplained
      @CodeExplained  3 года назад

      Don't you have a typo here: butoane???

    • @kissmonica9071
      @kissmonica9071 3 года назад

      @@CodeExplained ^-^ it's buttons in romanian, i changed the name of the array of buttons

    • @CodeExplained
      @CodeExplained  3 года назад

      oh okay.
      can you show me the error from your console

    • @kissmonica9071
      @kissmonica9071 3 года назад

      @@CodeExplained i work in Notepad++, the buttons do not appear, but the condition added_btns%8 == 0 is available, i'll try to figure it out

    • @kissmonica9071
      @kissmonica9071 3 года назад

      @@CodeExplained JavaScript error: Uncaught TypeError: Cannot read property 'innerHTML' of null on line 221, line 221: input_element.innerHTML += ``; , also const input_element = document.querySelector('.input');

  • @fishmarkholmes1834
    @fishmarkholmes1834 3 года назад

    Please make tutorial, how to make “ karate game “ in JavaScript.

  • @gordonfreeman_wf
    @gordonfreeman_wf 3 года назад +1

    Thanks for the video. it is really amazing. Why did you use "eval()"? On developer.mozilla.org I saw a warning that it is an enormous security risk : "Warning: Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use eval()"

    • @CodeExplained
      @CodeExplained  3 года назад +1

      Yeah that's true, there is a work around to fix the issue. but I didn't want to talk about it. because at the end, it's just a Calculator project.

    • @gordonfreeman_wf
      @gordonfreeman_wf 3 года назад

      @@CodeExplained thanks, your video lesson is very helpful. great work

    • @kumarniloy1798
      @kumarniloy1798 3 года назад

      @@gordonfreeman_wf Yeah hacker can hack you website using sql injection if you use eval()... for morw details you can study a hacking lab call eval() sql inj.. ... www.portswigger.com

  • @OrgilsYTChannel
    @OrgilsYTChannel 3 года назад +1

    Html code where is???

  • @uroojusman7439
    @uroojusman7439 3 года назад

    Can anyone tell me, how did he add symbols like under root and delete symbol in a string variable? I am new to JavaScript :(

  • @alameenahmadrufai3543
    @alameenahmadrufai3543 2 года назад

    Hey can you drop the final code for reference

  • @nguyennghia3708
    @nguyennghia3708 3 года назад

    You can hepl me fix
    Cos(90)=0 and sin(180)=0

  • @GIRUUUR
    @GIRUUUR 2 года назад

    Really bad overcomplicated solution.

  • @dmitryrei9264
    @dmitryrei9264 Год назад

    Sorry, sir. But when you do a calculator using "eval" it's always fail, cause most of the Tech Courses or Training Programs require to make a calculator without eval 🥲