You are watching: Difference between a method and a function
function functionName(parameters) // ContentFeatures:The function is executed as soon as something calls/invokes it.The name might contain letters, digits, dissension signs, underscore.Parameters are provided inside round parenthesis after the name of the function.Arguments are values a function receives when it is invoked.When the manage reaches the return statement, js will stop executing and also the value is returned to the caller.Example: below is the duty to add two numbers.
See more: The Water On The Earth Today Has Been Sustaining Life For Millions Of Years.
Output:Rahul works v Department salesDifference Between duty and Method:
Differences between IPv4 and IPv6Difference between GitLab and also GitHubDifference between Linear and Non-linear Data StructuresDifference in between DELETE and also TRUNCATEDifferences and Applications of List, Tuple, collection and dictionary in Python