Pro tip to help remember arguments vs parameters
I know a lot of people struggle with arguments and parameters, I know, I've been there too,
I came across this tip a long time ago, and I thought it was useful.
Arguments = Actual values
Parameters = Placeholder values
And we always pair are arguments with our parameters
Also when you are defining the function is when we assign parameters (placeholders because we
don't know what values will be passed in)
When we invoke / actually use our function is when we actually pass in arguments (actual values)
function addNums(a, b) { <== Parameters / Placeholder values
return a + b;
}
addNums(3, 5) <== Arguments / Actual values
Hope this helps,
Cheers!
10
7 comments
Ronald Paek
4
Pro tip to help remember arguments vs parameters
Developer Pro
skool.com/developerpro
Learn how to code. Make money. Have fun. Enjoy life.
Leaderboard (30-day)
powered by