📜  4.6.3.操作顺序¶ - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:46.933000             🧑  作者: Mango

代码示例1
/*Due to an historical quirk, an exception to the left-to-right rule 
is the exponentiation operator **. A useful hint is to always use 
parentheses to force exactly the order you want when exponentiation 
is involved:*/

// the right-most ** operator is applied first
console.log(2 ** 3 ** 2)

// use parentheses to force the order you want
console.log((2 ** 3) ** 2)

//512
//64