I've been pondering this question for quite some time. Grateful to anyone who can provide some insight!
let foo = {key: 'value'};
Scenario 1:
const stringToObject = function(objectName){
console.log(someUnknownFunction(objectName));
};
stringToObject('foo'); // displays an object: {key: 'value'}
Scenario 2:
const objectToString = function(objectName){
console.log(someUnknownFunction(objectName));
};
objectToString(foo); // shows a string: 'foo'