Is the double asterisk ** a valid JavaScript operator?

后端 未结 3 603
我寻月下人不归
我寻月下人不归 2021-01-03 17:52

I solved a kata on CodeWars and was looking through some of the other solutions when I came across the double asterisk to signify to the power of. I have done some research

3条回答
  •  耶瑟儿~
    2021-01-03 18:14

    Yes. ** is the exponentiation operator and is the equivalent of Math.pow.

    It was introduced in ECMAScript 2016 (ES7).

    For details, see the proposal and this chapter of Exploring ES2016.

提交回复
热议问题