Skip to content

Commit

Permalink
Update comment syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddily authored Jan 2, 2024
1 parent d84683b commit 17f5993
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ function receiveInput(character) {
}

/**
* Captures mouse clicks on number buttons and stores selected (clicked) data
* Captures mouse clicks on number buttons and stores selected (clicked) data.
* The event listener is applied to number buttons from 0 to 9 and decimal point button.
*/
function listenForOperandClick() {
// The event listener is applied to number buttons from 0 to 9 and decimal point button
numberButtons.forEach((numberButton) => {
numberButton.addEventListener('click', () => {
receiveInput(numberButton.textContent);
Expand Down Expand Up @@ -259,7 +259,6 @@ function handleOperator(operator) {
function listenForOperatorClick() {
operators.forEach((operator) => {
operator.addEventListener('click', () => {
// Pass the received operator to be handled
handleOperator(operator);
})
});
Expand Down Expand Up @@ -391,14 +390,14 @@ function listenForEqualClick() {
function listenForEqualKeyDown() {
window.addEventListener('keydown', (e) => {
if (e.key == '=') {
/* Add styling to equal key when pressed */
// Add styling to equal key when pressed
const element = document.querySelector('.equal');
element.classList.add('active');

handleEqual();
}
});
/* Remove styling given to equal key when released */
// Remove styling given to equal key when released
window.addEventListener('keyup', (e) => {
const element = document.querySelector('.equal');
element.classList.remove('active');
Expand Down

0 comments on commit 17f5993

Please sign in to comment.