From 532b64f3d4e7ad0feae00a71a67e7f7de6750360 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Fri, 26 Mar 2021 08:13:54 +0300 Subject: [PATCH] closes #2547 --- 1-js/02-first-steps/08-operators/article.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/1-js/02-first-steps/08-operators/article.md b/1-js/02-first-steps/08-operators/article.md index a4958b87..498870e4 100644 --- a/1-js/02-first-steps/08-operators/article.md +++ b/1-js/02-first-steps/08-operators/article.md @@ -56,17 +56,21 @@ alert( 8 % 3 ); // 2, a remainder of 8 divided by 3 ### Exponentiation ** -The exponentiation operator `a ** b` multiplies `a` by itself `b` times. +The exponentiation operator `a ** b` raises `a` to the power of `b`. + +In school maths, we write that as ab. For instance: ```js run -alert( 2 ** 2 ); // 4 (2 multiplied by itself 2 times) -alert( 2 ** 3 ); // 8 (2 * 2 * 2, 3 times) -alert( 2 ** 4 ); // 16 (2 * 2 * 2 * 2, 4 times) +alert( 2 ** 2 ); // 2² = 4 +alert( 2 ** 3 ); // 2³ = 8 +alert( 2 ** 4 ); // 2⁴ = 16 ``` -Mathematically, the exponentiation is defined for non-integer numbers as well. For example, a square root is an exponentiation by `1/2`: +Just like in maths, the exponentiation operator is defined for non-integer numbers as well. + +For example, a square root is an exponentiation by ½: ```js run alert( 4 ** (1/2) ); // 2 (power of 1/2 is the same as a square root)