简体   繁体   中英

JavaScript's exponentiation operator works in Chrome but will choke Node?

The exponential operator in JavaScript is documented , and has the form:

  2 ** 3    // ==> 8, which is 2 to the power 3

but it works in Google Chrome, and choke Node.js?

It's an ES7 feature, and only works in Node >7.

See: http://kangax.github.io/compat-table/es2016plus/ for a complete list of browsers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM