Skip to content

Convert prompt inputs to numbers with unary plus#3977

Merged
smith558 merged 1 commit into
javascript-tutorial:masterfrom
Lk-ux:patch-3
Jul 25, 2026
Merged

Convert prompt inputs to numbers with unary plus#3977
smith558 merged 1 commit into
javascript-tutorial:masterfrom
Lk-ux:patch-3

Conversation

@Lk-ux

@Lk-ux Lk-ux commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

The task description says the function should take natural numbers only, but prompt() returns String, which we pass to pow().
It accidentally works because we use *= operator which performs implicit conversion.
But it is best to convert explicitly to improve code readability and align better with the task requirement.

Added unary plus to prompt inputs for type conversion.
@javascript-translate-bot javascript-translate-bot added review needed Review needed, please approve or request changes labels Jul 4, 2026
@javascript-translate-bot
javascript-translate-bot requested a review from a team July 4, 2026 10:09
@smith558 smith558 self-assigned this Jul 25, 2026
@smith558

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: a197375526

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@javascript-translate-bot javascript-translate-bot added needs +1 One more review needed and removed review needed Review needed, please approve or request changes labels Jul 25, 2026
@smith558 smith558 added needs +1 One more review needed and removed needs +1 One more review needed labels Jul 25, 2026
@smith558
smith558 merged commit 2020876 into javascript-tutorial:master Jul 25, 2026
1 check passed
@smith558

Copy link
Copy Markdown
Member

Thank you for your contribution! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs +1 One more review needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants