From be17457831fb811cc9d9406b72e0d943eca9ee93 Mon Sep 17 00:00:00 2001 From: saqhibbilal Date: Mon, 16 Sep 2024 00:21:42 +0530 Subject: [PATCH 1/2] Solved the Lab --- src/functions-and-arrays.js | 224 +++++++++++++++++++++++++++++++++--- 1 file changed, 211 insertions(+), 13 deletions(-) diff --git a/src/functions-and-arrays.js b/src/functions-and-arrays.js index 3a7dbec..9c23810 100644 --- a/src/functions-and-arrays.js +++ b/src/functions-and-arrays.js @@ -1,41 +1,132 @@ // Iteration #1: Find the maximum -function maxOfTwoNumbers() {} - +function maxOfTwoNumbers(n1,n2) { + if(n1>n2){ + return n1; + }else if(n2>n1){ + return n2; + }else{ + return "equal"; + } + +} +console.log(maxOfTwoNumbers(4,4)); // Iteration #2: Find longest word -const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot']; +const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot','thelongestwordbutnotaword']; + +function findLongestWord(words) { + if (words.length === 0) { + return null; + } -function findLongestWord() {} + let longestWord = words[0]; + for (let i = 1; i < words.length; i++) { + if (words[i].length > longestWord.length) { + longestWord = words[i]; + } + } + + return longestWord; +} +console.log(findLongestWord(words)); // Iteration #3: Calculate the sum const numbers = [6, 12, 1, 18, 13, 16, 2, 1, 8, 10]; -function sumNumbers() {} +function sumNumbers(numbers) { + let summed = 0; + for(let i=0;i maxProduct) { + maxProduct = horizontalProduct; + } + } + } + + // Check vertically + for (let i = 0; i < matrix.length - 3; i++) { + for (let j = 0; j < matrix[i].length; j++) { + const verticalProduct = + matrix[i][j] * matrix[i + 1][j] * matrix[i + 2][j] * matrix[i + 3][j]; + if (verticalProduct > maxProduct) { + maxProduct = verticalProduct; + } + } + } + + return maxProduct; +} +console.log(greatestProduct(matrix)); // This will return the greatest product + +//Bonus - Iteration #8.1: Product of diagonals + + +function greatestProductOfDiagonals(matrix) { + let greatestProduct = 0; + + const numRows = matrix.length; + const numCols = matrix[0].length; + + // Check diagonals from top-left to bottom-right (right diagonal) + for (let row = 0; row <= numRows - 4; row++) { + for (let col = 0; col <= numCols - 4; col++) { + let product = matrix[row][col] * + matrix[row + 1][col + 1] * + matrix[row + 2][col + 2] * + matrix[row + 3][col + 3]; + if (product > greatestProduct) { + greatestProduct = product; + } + } + } + + // Check diagonals from top-right to bottom-left (left diagonal) + for (let row = 0; row <= numRows - 4; row++) { + for (let col = 3; col < numCols; col++) { + let product = matrix[row][col] * + matrix[row + 1][col - 1] * + matrix[row + 2][col - 2] * + matrix[row + 3][col - 3]; + if (product > greatestProduct) { + greatestProduct = product; + } + } + } + + return greatestProduct; +} +console.log(greatestProductOfDiagonals(matrix)); // The following is required to make unit tests work. From c192e41c1dac0cdeafca40f0c09cb763c76685bc Mon Sep 17 00:00:00 2001 From: saqhibbilal Date: Mon, 16 Sep 2024 00:44:03 +0530 Subject: [PATCH 2/2] Automation Testing using Jest --- lab-solution.html | 525 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 525 insertions(+) create mode 100644 lab-solution.html diff --git a/lab-solution.html b/lab-solution.html new file mode 100644 index 0000000..4256c7b --- /dev/null +++ b/lab-solution.html @@ -0,0 +1,525 @@ +Lab Solution

Lab Solution

Started: 2024-09-16 00:13:23
Suites (1)
0 passed
1 failed
0 pending
Tests (53)
47 passed
6 failed
0 pending
Find the maximum
should declare a function named maxOfTwoNumbers
passed
0.003s
Find the maximum
should return greater of two arguments - if the first argument greater
passed
0s
Find the maximum
should return greater of two arguments - if the second argument greater
passed
0.001s
Find the maximum
should return either arguments - if both arguments are equal
failed
0.003s
Error: expect(received).toBe(expected) // Object.is equality
+
+Expected: 4
+Received: "equal"
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:45:35)
+    at Object.asyncJestTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\jasmineAsyncInstall.js:106:37)
+    at C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:45:12
+    at new Promise (<anonymous>)
+    at mapper (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:28:19)
+    at C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:75:41
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
Find the longest word
should declare a function named findLongestWord
passed
0.001s
Find the longest word
should return null when called with an empty array
passed
0s
Find the longest word
should return the word when called with a single-word array
passed
0s
Find the longest word
should return the first occurrence of the word when longest have multiple occurrences
passed
0s
Find the longest word
should return the longest occurrence when it has multiple words
passed
0.001s
Calculate the sum of array of numbers
should declare a function named sumNumbers
passed
0.001s
Calculate the sum of array of numbers
should return zero if receives an empty array when called
passed
0s
Calculate the sum of array of numbers
should return the sum with one number array
passed
0s
Calculate the sum of array of numbers
should return zero if all elements are zero
passed
0.001s
Calculate the sum of array of numbers
should return the sum when passed array of numbers
passed
0s
Bonus: Calculate the sum
should declare a function named sum
passed
0.001s
Bonus: Calculate the sum
should return zero if receives an empty array when called
passed
0s
Bonus: Calculate the sum
should return the sum with one number array
passed
0s
Bonus: Calculate the sum
should return zero if all elements are zero
passed
0s
Bonus: Calculate the sum
should return the sum when passed array of numbers
passed
0.001s
Bonus: Calculate the sum
should return the sum when passed array of strings
passed
0s
Bonus: Calculate the sum
should return the sum when passed array of mixed strings and numbers -
passed
0s
Bonus: Calculate the sum
should return the sum when passed array of mixed strings, numbers and booleans -
passed
0s
Bonus: Calculate the sum
should throw an error when unsupported data type (object or array) present in the array
failed
0.001s
Error: expect(received).toThrow(expected)
+
+Expected message: "Unsupported data type sir or ma'am"
+
+Received function did not throw
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:133:81)
+    at Object.asyncJestTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\jasmineAsyncInstall.js:106:37)
+    at C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:45:12
+    at new Promise (<anonymous>)
+    at mapper (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:28:19)
+    at C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:75:41
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
Calculate the average of an array of numbers
should declare a function named averageNumbers
passed
0.001s
Calculate the average of an array of numbers
should return null if receives an empty array when called
failed
0s
Error: expect(received).toBe(expected) // Object.is equality
+
+Expected: null
+Received: NaN
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:145:32)
+    at Object.asyncJestTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\jasmineAsyncInstall.js:106:37)
+    at C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:45:12
+    at new Promise (<anonymous>)
+    at mapper (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:28:19)
+    at C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:75:41
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
Calculate the average of an array of numbers
should return the average of a one-element array
passed
0.001s
Calculate the average of an array of numbers
should return the average even with negative values
passed
0s
Calculate the average of an array of numbers
should return the average of the array
passed
0s
Calculate the average of an array of strings
should declare a function named averageWordLength
passed
0.001s
Calculate the average of an array of strings
should return null if receives an empty array when called
passed
0s
Calculate the average of an array of strings
should return the average of a one-element array
passed
0s
Calculate the average of an array of strings
should return the average of a the array
passed
0.001s
Bonus: Calculate the average of a mixed elements array
should declare a function named avg
failed
0.003s
Error: expect(received).toBe(expected) // Object.is equality
+
+Expected: "function"
+Received: "number"
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:183:24)
+    at Object.asyncJestTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\jasmineAsyncInstall.js:106:37)
+    at C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:45:12
+    at new Promise (<anonymous>)
+    at mapper (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:28:19)
+    at C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:75:41
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
Bonus: Calculate the average of a mixed elements array
should return null if receives an empty array when called
failed
0s
TypeError: avg is not a function
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:187:12)
+    at Object.asyncJestTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\jasmineAsyncInstall.js:106:37)
+    at C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:45:12
+    at new Promise (<anonymous>)
+    at mapper (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:28:19)
+    at C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:75:41
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
Bonus: Calculate the average of a mixed elements array
should return the average of the array
failed
0.001s
TypeError: avg is not a function
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:192:12)
+    at Object.asyncJestTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\jasmineAsyncInstall.js:106:37)
+    at C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:45:12
+    at new Promise (<anonymous>)
+    at mapper (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:28:19)
+    at C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\queueRunner.js:75:41
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
Unique array
should declare a function named uniquifyArray
passed
0s
Unique array
should return null if receives an empty array when called
passed
0.006s
Unique array
should return the correct uniqified array when an array of the same elements passed as argument
passed
0s
Unique array
should return the same array when no element is repeated
passed
0.001s
Unique array
should return the uniquified array
passed
0s
Find elements
should declare a function named doesWordExist
passed
0s
Find elements
should return null if receives an empty array when called
passed
0.001s
Find elements
should return true if the word we are looking for is the only one in the array
passed
0s
Find elements
should return false if the word we are looking for is not in the array
passed
0s
Find elements
should return true if the word we are looking for is in the array
passed
0s
Count repetition
should declare a function named howManyTimes
passed
0s
Count repetition
should return 0 (zero) if receives an empty array when called
passed
0.001s
Count repetition
should return 1 (one) when the word appears only one time in the array
passed
0s
Count repetition
should return 0 (zero) when the word doesn't appear in the array
passed
0s
Count repetition
should return 5 (five) when the word appears 5 times in the array
passed
0s
Bonus Quest - greatestProduct
should declare a function named greatestProduct
passed
0s
Bonus Quest - greatestProduct
should return 1 (one) when all numbers of the arrays are 1
passed
0.001s
Bonus Quest - greatestProduct
should return 16 when all the numbers of the arrays are 2
passed
0s
Console Log
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:12:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
equal
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:33:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
thelongestwordbutnotaword
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:48:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
87
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:72:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
57
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:83:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
6
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:103:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
5.3
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:129:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
5.7
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:162:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
[
+  'crab',
+  'poison',
+  'contagious',
+  'simple',
+  'bring',
+  'sharp',
+  'playground',
+  'communion'
+]
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:181:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
true
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:182:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
false
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:212:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
4
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:213:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
1
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:214:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
0
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:269:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
51267216
    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\src\functions-and-arrays.js:309:9)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at Runtime.require [as requireModuleOrMock] (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:919:21)
+    at Object.<anonymous> (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\tests\functions-and-arrays.spec.js:13:5)
+    at Runtime._execModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:1299:24)
+    at Runtime._loadModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:898:12)
+    at Runtime.requireModule (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runtime\build\index.js:746:10)
+    at jasmine2 (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-jasmine2\build\index.js:230:13)
+    at runTestInternal (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:380:22)
+    at runNextTicks (node:internal/process/task_queues:60:5)
+    at processTimers (node:internal/timers:516:9)
+    at runTest (C:\Users\USER\Desktop\trioes\lab-javascript-functions-and-arrays\node_modules\jest-runner\build\runTest.js:472:34)
70600674
\ No newline at end of file