From e1e1f1cabbf85e02398a48c9955687a9ea1f322f Mon Sep 17 00:00:00 2001 From: Olayemi Adebayo Roheem <40640678+Tekcoder@users.noreply.github.com> Date: Fri, 21 Dec 2018 11:09:38 +0100 Subject: [PATCH] =?UTF-8?q?Add=20the=20text=20"x=20=3D=20true;=20console.l?= =?UTF-8?q?og(type=20of=20x)=20//=20boolean=20```=20=20From=20t=E2=80=A6?= =?UTF-8?q?=20(#26111)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add the text "x = true; console.log(type of x) // boolean ``` From the last example above, The `typeof` operator returns a boolean that represents the current type of a variable; x which is of value `true`." * Revert extra sentence --- guide/english/javascript/typeof/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guide/english/javascript/typeof/index.md b/guide/english/javascript/typeof/index.md index a2f16f8718..2e2af4b6b8 100644 --- a/guide/english/javascript/typeof/index.md +++ b/guide/english/javascript/typeof/index.md @@ -25,6 +25,8 @@ x = 'string'; console.log(typeof x) // string x = { key: 'value' }; console.log(typeof x) // object +x = true; +console.log(type of x) // boolean ``` This can be useful for checking the type of a variable in a function and continuing as appropriate.