Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Pure JavaScript Calculator Code ES6 Learn JavaScript
Rating: 4.5 out of 5(218 ratings)
15,827 students

Pure JavaScript Calculator Code ES6 Learn JavaScript

Explore how you can create a fully functional JavaScript calculator with only JavaScript - simple project to practice
Created byLaurence Svekis
Last updated 11/2024
English

What you'll learn

  • Create an online calculator from scratch
  • Apply JavaScript in a simple project
  • Learn how to create DOM elements

Course content

2 sections19 lectures44m total length
  • Calculator Project Introduction2:16

    Build a calculator from scratch using only javascript, manipulating the dom to build and control the interface. Learn through applying logic to perform calculations and updating the page dynamically.

  • Web development Setup1:43

    Set up the basic structure for a pure JavaScript calculator, creating an index page, linking app.js, and using Brackets with live preview and developer tools for debugging.

  • DOM Content Loaded1:38

    Use the DOMContentLoaded event on the window to ensure the document is loaded before manipulating DOM elements, and log that the page is ready to the console.

  • Source Code0:01
  • Setup Calculator Values3:08

    Define calculator values and arrays for digits and operations, update the document title dynamically with JavaScript, and prepare global options and DOM-ready setup for the calculator.

  • Create DOM page Elements7:05

    Create a dynamic calculator interface by building a main container, an output screen, and a keys area with the document object model and styling.

  • Source Code0:14
  • Add Keys to Calculator4:31

    Dynamically build calculator keys from an ops array, use for each to create buttons, console log each value, and attach click handlers that update the output for later lessons.

  • Source Code0:22
  • Output to Screen Logic2:12

    Apply logic and functionality to the calculator to output content. Capture the event target key pressed, update the output input tag, and prepare for clear and evaluate steps.

  • Source Code0:23
  • JavaScript Eval function Eval Key5:20

    Add an equal sign and clear button to the calculator object, implement evaluate using eval, and handle output styling and basic error cases to enable valid calculations.

  • Source Code0:31
  • Bug Fixes Decimal Handling4:47

    Fix decimal handling in a pure JavaScript calculator by adding switches for decimal and evaluation, preventing extra decimals and signaling errors with a red border, using includes to verify values.

  • Source Code0:37
  • Final Bug Fixes and Code Review7:10

    Guard against invalid input and decimal issues, use the C output function to reset colors and signal errors, and review debugging with console logs and dynamic buttons.

  • Bug Fix quick update1:26

    Fixes a bug in the javascript calculator by using the includes method to detect a decimal point and enable a dc switch, preventing multiple decimal places.

  • Source Code0:37

Requirements

  • JavaScript HTML and CSS
  • Prior programming experience

Description

Practice your JavaScript coding skills, explore how you can create a fully functional dynamic calculator ONLY using JavaScript

Learn more about JavaScript and how JavaScript ES6 can be applied to create amazing JavaScript projects.  Course is loaded with JavaScript Examples and perfect JavaScript for Beginners to learn more about JavaScript Online.  Writing JavaScript Code using vanilla JavaScript - no libraries no tricks this JavaScript tutorial the JavaScript Course will walk you through creating your own JavaScript code and provide many JavaScript Code Snippets for use in JavaScript programming.  Learn JavaScript with this step by step JavaScript Course.

Yes that's correct, no HTML no CSS everything is done with JavaScript

JavaScript is a prerequisites to this course - YOU MUST KNOW JAVASCRIPT TO TAKE THIS COURSE!!!!!

This course covers :

  • Using JavaScript to create DOM elements

  • Adding elements to the page

  • Using Arrays of data to construct page content

  • Adding event listeners to elements

  • Updating and evaluating string values

  • Troubleshooting and bug fixes for application

  • Walk through of how to create the JavaScript Calculator

Source Code is included.

Enjoy learning have fun!!!!

Try the code for yourself and explore what you can do with JavaScript

Fast Friendly support to help answer any questions you might have and to help clarify content is always available in the Q&A section.  Taught by an instructor with over 20 years real world experience ready to help you learn more.  Step by step training resources and source code is also included to get you started quickly.


Who this course is for:

  • Web application developers
  • Web designers
  • Web masters
  • Web coders
  • JavaScript Developers
  • Anyone who wants to learn more about JavaScript