Functions

Description (MDN) - Used to perform specified instructions

const myDetails = {
         name : "javascript"
}

function sayMyName(detailsObj){               //function taking 1 argument
return detailsObj.name;
}

console.log(sayMyName(myDetails));         //calling function with myDetails

Discussion

Be the first one to comment!