this question is not meant to find a solution for the task but to understand as the title says. I could not categorize the question. Without further ado. I began practicing Javascript on the website freecodecamp.org last month. My main concern is the set up of the function:
var someObj = {
propName: "John"
};
function propPrefix(str) {
var s = "prop";
return s + str;
}
var someProp = propPrefix("Name"); // someProp now holds the value 'propName'
console.log(someObj[someProp]); // "John"
What I do not understand is the 'function'-part. What does it return? The return statement returns 's' with its value "prop" and 'str'. But what value does 'str' hold? Is it the whole content of the function propPrefix? Idont seem to be able to wrap my head around that.