From 4bd3aeb8269e4362d8eef748c30e08b4b1d0bdd0 Mon Sep 17 00:00:00 2001 From: Govind Date: Mon, 26 Jan 2026 16:39:22 +0530 Subject: [PATCH 1/4] add additional multiplication function call --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 713abd2..0486aea 100644 --- a/index.js +++ b/index.js @@ -18,3 +18,4 @@ mul(1 ,8) mul(4, 5) mul(6,8) mul(78,90) +mul(8,9) From 0b5a3adedaa98390bcf31140ce7597cc71ee08f5 Mon Sep 17 00:00:00 2001 From: Govind Date: Mon, 26 Jan 2026 16:48:05 +0530 Subject: [PATCH 2/4] add additional multiplication function call --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 0486aea..82255aa 100644 --- a/index.js +++ b/index.js @@ -19,3 +19,4 @@ mul(4, 5) mul(6,8) mul(78,90) mul(8,9) +mul(78,98) From 6d803c5a9acf25aca67ce67c3f8c5f92dbb77359 Mon Sep 17 00:00:00 2001 From: Govind Date: Mon, 26 Jan 2026 16:56:22 +0530 Subject: [PATCH 3/4] add input validation for multiplication function --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 82255aa..af78a42 100644 --- a/index.js +++ b/index.js @@ -6,6 +6,7 @@ function sub(a, b){ return a-b } function multi (a,b){ + if (a<0 || b<0) throw a new error ("no a , b must be positive") return a*b } From 3ab676a1d83edaf0653c94608ab6a4e280884684 Mon Sep 17 00:00:00 2001 From: Govind Date: Mon, 26 Jan 2026 17:14:00 +0530 Subject: [PATCH 4/4] fix: correct error handling in subtraction and multiplication functions --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index af78a42..ecb9b0d 100644 --- a/index.js +++ b/index.js @@ -2,11 +2,11 @@ function add(a ,b){ return a + b } function sub(a, b){ - if(!(a>b)) throw new error (" no . a must be greater than b") + if(!(a>b)) throw new Error (" no . a must be greater than b") return a-b } function multi (a,b){ - if (a<0 || b<0) throw a new error ("no a , b must be positive") + if (a<0 || b<0) throw new Error ("no a , b must be positive") return a*b }