Skip to content

12_calculator: Use operator instead of method in the solution #571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Eduardo06sp
Copy link
Member

@Eduardo06sp Eduardo06sp commented Aug 10, 2025

Because

when learning about JavaScript operators, we are introduced to different operators (here: https://javascript.info/operators). Therefore, the solution (to get the power) for the calculator exercise should just stick to using the exponentiation operator (**) instead of a method that seems to come out of nowhere.

This PR

  • Replaces the solution for 12_calculator (where you get the power) with a**b (instead of Math.pow(a, b))

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this PR follows the location of change: brief description of change format, e.g. 01_helloWorld: Update test cases
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If this PR includes any changes that affect the solution of an exercise, I've also updated the solution in the /solutions folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant