Solution: Nested Loop With Multiplication (Intermediate)
This review provides a detailed analysis of the different ways to solve the Nested Loop with Multiplication (Intermediate) challenge.
We'll cover the following...
Solution
Node.js
// Initializationsconst n = 10;const pie = 3.14;let sum = 0;var j = 1;for (var i = 1; i < n; i += 3) {console.log(pie);while (j < n) {sum = sum + 1;j *= 3;}j = 1;}console.log(sum)
-
The outer loop index
igoes: . That means that the outer loop has ...
Ask