From 18255d14d45bafd17038b2d9032006fe9e1e1003 Mon Sep 17 00:00:00 2001 From: Tonni Date: Mon, 26 Jun 2017 23:00:26 +0800 Subject: [PATCH] [guide] Add documentation for exponentiation operator (`**`). --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fbd0ffe..59d2c994 100644 --- a/README.md +++ b/README.md @@ -1498,6 +1498,16 @@ Other Style Guides const isJedi = getProp('jedi'); ``` + + - [12.3](#es2016-properties--exponentiation-operator) Use exponentiation operator `**` when calculating exponentiations. eslint: [`no-restricted-properties`](http://eslint.org/docs/rules/no-restricted-properties). + + ```javascript + // bad + const binary = Math.pow(2, 10); + + // good + const binary = 2 ** 10; + ``` **[⬆ back to top](#table-of-contents)** @@ -3116,7 +3126,7 @@ Other Style Guides ## ECMAScript 6+ (ES 2015+) Styles - - [28.1](#es6-styles) This is a collection of links to the various ES6 features. + - [28.1](#es6-styles) This is a collection of links to the various ES6+ features. 1. [Arrow Functions](#arrow-functions) 1. [Classes](#classes--constructors) @@ -3129,6 +3139,7 @@ Other Style Guides 1. [Rest](#es6-rest) 1. [Array Spreads](#es6-array-spreads) 1. [Let and Const](#references) +1. [Exponentiation Operator](#es2016-properties--exponentiation-operator) 1. [Iterators and Generators](#iterators-and-generators) 1. [Modules](#modules)