My javascript code keeps telling me Parsing Error: Unexpected Token Calculator

Here is all of my code and even when I try to delete the code it is still there.

Code:
const numberButtons = document.querySelectorAll(’[data-number]’)
const operationButtons = document.querySelectorAll(’[data-operation]’)
const equalsButton = document.querySelector(’[data-equals]’)
const deleteButton = document.querySelector(’[data-delete]’)
const allClearButton = document.querySelector(’[data-all-clear]’)
const previousOperandTextElement = document.querySelector(’[data-previous-operand]’)
const currentOperandTextElement = document.querySelector(’[data-current-operand]’)

class Calculator {
constructor(previousOperandTextElement, currentOperandTextElement) {
this.previousOperandTextElement = previousOperandTextElement
this.currentOperandTextElement = currentOperandTextElement
this.clear()
}

new Calculator(previousOperandTextElement, currentOperandTextElement)

The bolded text is where the error come up.

I found the tutorial you are working on. Did you also write out the HTML and CSS for the project?

1 Like

I think my question was sufficient. I really don’t need someone to tell me how to interact on this forum.

ok ok, i was just recommended in case there is some other file interfering (dont ask why). sorry if i was interfering/telling you something you know.

Thanks, no worries. Asking to see the project is usually the way to go, but they said, “here is all my code” so I assume that’s all of it.

you’ve closed the constructor body with the } toward the bottom, but you haven’t closed the class definition

do you have a moment to talk about our savior, code formatting?

1 Like

Thanks everyone, but I fixed it. I forgot to close the second part so wh0 was right.

1 Like

heres the other code:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.