From 31744d85393ac253bea68e11daf723ebc4b624e1 Mon Sep 17 00:00:00 2001 From: satya Date: Tue, 19 Jul 2022 21:39:40 +0530 Subject: [PATCH] level2 modified --- solutions/day-2/level2.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/solutions/day-2/level2.js b/solutions/day-2/level2.js index b1df231..6fa5572 100644 --- a/solutions/day-2/level2.js +++ b/solutions/day-2/level2.js @@ -27,6 +27,19 @@ console.log(Math.floor(Math.random() * 225)); // 10.question // 11.question +for (let i = 0; i < 5; i++) { + for (let j = 0; j < 5; j++) { + if (j == 1) { + console.log(1); + } + else if (j == 0 || j == 2) { + console.log(i+1); + } else { + console.log(Math.pow(i+1,j-1)); + } + } + console.log(' '); +} console.log( `1 1 1 1 1 2 1 2 4 8 @@ -40,3 +53,5 @@ let i = sent.indexOf('because'); let j = sent.lastIndexOf('because'); let len = 'because'.length; console.log(sent.slice(i, j+len)); + +