Skip to content
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

** 乘方运算符 #48

Open
lovelmh13 opened this issue Aug 23, 2020 · 0 comments
Open

** 乘方运算符 #48

lovelmh13 opened this issue Aug 23, 2020 · 0 comments

Comments

@lovelmh13
Copy link
Owner

lovelmh13 commented Aug 23, 2020

在mdn里 中文版没有**运算符,需要看英文版

  1. **运算符是右结合的
    4 ** 3 ** 2 === 4 ** (3 ** 2) // 最终结果是 262144, 而不是 4096

++i ** 30
2 ** 30 //正确
-2 ** 30 //报错

如果要用-2这样的一元表达式,需要用() (-2)**2

表达式和运算符
Exponentiation (**)

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

No branches or pull requests

1 participant