Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In JAVASCRIPT write code in this function to concatenate the elements of an array (parameter) into a string, and return the new string. Put a
In JAVASCRIPT
write code in this function to concatenate the elements of an array (parameter) into a string, and return the new string.
Put a space between each element (string) in the return string. The sentence should start with a capital letter and end with a full stop.
arrToProccess is the array that's passed in.
function makeString(arrToProcess) {
//write the code In this function
//return the processed array as a string with the variable strReturn
return strReturn;
}
Should pass this test;
QUnit.test('Test makeString function', function( assert ) { let arrTest1 = ["hello", "world", "from", "APP"]; let strResult1 = "Hello world from APP."; let arrTest2 = ["it","is", "a", "wonderful","day"]; let strResult2 = "It is a wonderful day."; assert.equal(makeString(arrTest1), strResult1, "Make string function testi worked"); assert.equal(makeString(arrTest2), strResult2, "Make string function test2 worked"); })Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started