You are given two values a and b of identical type: numbers, strings or arrays. The result will be:
a and b if the parameters are numbers.
a and b if the parameters are strings.
a and b in a single array if the parameters are arrays.
In any case, you don't have to simply return the result. This challenge will be a little different from usual because your function is going to return the same Test Case that verifies the correctness of your function!
When you try to solve a challenge your function is passed to a Test function, that accepts three parameters: your function with its related parameters, the expected result, and an optional comment (not used in this exercise).
There are two different types for a Test function:
Test.assertEquals(yourFunctionName(firstParameter, ..., lastParameter), result)
This is used when the value type of the expected result is primitive (numbers, strings, booleans or special values like undefined, null and NaN).
Test.assertSimilar(yourFunctionName(firstParameter, ..., lastParameter), result)
This is used when the value type of the expected result is an object (arrays or object literals).
You must return a string containing the Test function that verifies the correctness of the result that you got. See the examples below for a better explanation.
createTest(1, 1) ➞ 'Test.assertEquals(createTest(1, 1), 2)'
// Parameters are numbers, so result will be their sum: Test function verifies equality.
createTest("a", "b") ➞ 'Test.assertEquals(createTest("a", "b"), "ab")'
// Parameters are strings, so result will be their join: Test function verifies equality.
createTest(["String"], ["String"]) ➞ 'Test.assertSimilar(createTest(["String"], ["String"]), ["String", "String"])'
// Parameters are arrays, so result will be the concatenation of the values inside the arrays: Test function verifies similarity.
" around them in the returned string.