From 326118f736e654f34227ff82438328b7b5814244 Mon Sep 17 00:00:00 2001 From: Armend Date: Sun, 9 Aug 2020 01:20:56 -0400 Subject: [PATCH 1/2] =?UTF-8?q?Changed=20=E2=80=9Cvar=E2=80=9D=20to=20?= =?UTF-8?q?=E2=80=9Clet=E2=80=9D=20in=20DecimalToOctal.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved 1 liner code into 2 lines. --- Conversions/DecimalToOctal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Conversions/DecimalToOctal.js b/Conversions/DecimalToOctal.js index 5d37a56870..82c18dac08 100644 --- a/Conversions/DecimalToOctal.js +++ b/Conversions/DecimalToOctal.js @@ -1,5 +1,6 @@ function decimalToOctal (num) { - var oct = 0; var c = 0 + let oct = 0 + let c = 0 while (num > 0) { var r = num % 8 oct = oct + (r * Math.pow(10, c++)) From 1d938dad99e9266928305aae3d02698c9e82d5c6 Mon Sep 17 00:00:00 2001 From: vinayak Date: Wed, 19 Aug 2020 23:52:01 +0530 Subject: [PATCH 2/2] Update Conversions/DecimalToOctal.js Co-authored-by: Tapajyoti Bose <44058757+ruppysuppy@users.noreply.github.com> --- Conversions/DecimalToOctal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Conversions/DecimalToOctal.js b/Conversions/DecimalToOctal.js index 82c18dac08..6f9184b5ab 100644 --- a/Conversions/DecimalToOctal.js +++ b/Conversions/DecimalToOctal.js @@ -2,7 +2,7 @@ function decimalToOctal (num) { let oct = 0 let c = 0 while (num > 0) { - var r = num % 8 + const r = num % 8 oct = oct + (r * Math.pow(10, c++)) num = Math.floor(num / 8) // basically /= 8 without remainder if any } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy