From cfd9cb932cd3c15841bc01ecf6a52882d8ae9f0c Mon Sep 17 00:00:00 2001 From: JALA COX Date: Mon, 27 Feb 2023 11:48:04 -0600 Subject: [PATCH 1/5] j --- js/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/app.js b/js/app.js index 1ff8cc0..2da3027 100644 --- a/js/app.js +++ b/js/app.js @@ -9,6 +9,9 @@ Test this function by hand in the console to get it working, and when you think // Write your code here function sum(a, b) { //eslint-disable-line +sum = a + b; +return[sum,`The sum of ${4} and ${7} is ${11}.`]; +console.log } From dd40f8ba4546b74592b41c5675f0d1a92d9e8054 Mon Sep 17 00:00:00 2001 From: JALA COX Date: Mon, 27 Feb 2023 14:20:43 -0600 Subject: [PATCH 2/5] j --- js/app.js | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/js/app.js b/js/app.js index 2da3027..7bcb680 100644 --- a/js/app.js +++ b/js/app.js @@ -9,10 +9,8 @@ Test this function by hand in the console to get it working, and when you think // Write your code here function sum(a, b) { //eslint-disable-line -sum = a + b; +let sum = a + b; return[sum,`The sum of ${4} and ${7} is ${11}.`]; -console.log - } // Here is the test for sum(); uncomment it to run it @@ -24,13 +22,15 @@ console.log /* Problem 2 Write a function called multiply() that takes in two numbers as arguments and returns an array where the first element is the product of those numbers, and the second element is a string that EXACTLY follows this example and uses the values that were input into the function: -"The product of 5 and 9 is 45." +"" Test this function by hand in the console to get it working, and when you think it is finished, uncomment the call for the testMultiply() function and see if the test passes.*/ // Write your code here -function multiply(a, b) { //eslint-disable-line - +function multiply(a, b) { + //eslint-disable-line +let product = a * b +return[product,`The product of ${5} and ${9} is ${45}.`] } // Here is the test for multiply(); uncomment it to run it @@ -51,6 +51,22 @@ Test this function by hand in the console to get it working, and when you think // Write your code here function sumAndMultiply(a, b, c) { //eslint-disable-line +let sum = (a,b)[0]; +var sum2 = (sum, c)[0]; + +let product = multiply (a,b)[0]; +let pruduct2 = multiply (product, c)[0]; + +var str3A = a + ' and ' + b + ' and ' + c + ' sum to ' + sum2 + '.'; +var str3B = 'The product of' + a + 'and' + b + ' and ' + c + 'is' + product2 + '.'; +var arr3=[]; + arr3[0]= sum2; + arr3[1]= product2; + arr3[2] = str3A; + arr3[3] = str3B; + return arr3; + + } From b87795a28bc3d3001fb473be0bf718fd0067adf0 Mon Sep 17 00:00:00 2001 From: JALA COX Date: Mon, 27 Feb 2023 14:43:12 -0600 Subject: [PATCH 3/5] j --- js/app.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/app.js b/js/app.js index 7bcb680..8fab6df 100644 --- a/js/app.js +++ b/js/app.js @@ -88,6 +88,8 @@ Test this function by hand in the console to get it working, and when you think // Write your code here let testArray = [2, 3, 4]; //eslint-disable-line + + function sumArray(sumArr) { //eslint-disable-line } From 99dea461b50106834658b94b3646e41a532016ae Mon Sep 17 00:00:00 2001 From: JALA COX Date: Mon, 27 Feb 2023 14:55:36 -0600 Subject: [PATCH 4/5] jala --- js/app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/app.js b/js/app.js index 8fab6df..492d39a 100644 --- a/js/app.js +++ b/js/app.js @@ -87,6 +87,7 @@ Test this function by hand in the console to get it working, and when you think // Write your code here let testArray = [2, 3, 4]; //eslint-disable-line +let result = From e9d6cce11ce27ef1457334a72b34f1077dc0f8f7 Mon Sep 17 00:00:00 2001 From: JALA COX Date: Mon, 27 Feb 2023 14:57:02 -0600 Subject: [PATCH 5/5] q2