In my code, I want the function wrapInObject
to take two arguments, and encapsulate them into an object that is returned.
My code:
let FirstObject = {
k: 'FirstObject'
}
let SecondObject = {
l: 'SecondObject'
}
let wrapInObject = function(FirstObject, SecondObject){
return [FirstObject, SecondObject]
}
wrapInObject('FirstObject', 'SecondObject')
ska shall return an object like { k: 'FirstObject', l: 'SecondObject' }.
But I get returned some errors:
index.js
✓ exists
✓ is valid JavaScript
✓ defines wrapInObject of the type Function
1) defines wrapInObject such that it returns an object when called with the arguments 'FirstObject' and 'SecondObject'
2) defines wrapInObject such that it returns an object with the same content as { k: 'FirstObject', l: 'SecondObject' } when called with the arguments 'FirstObject' and 'SecondObject'
3) defines wrapInObject such that it returns the correct value when called with some other number arguments
What's wrong with my code?