What's the difference between an argument and a parameter?

后端 未结 30 1886
北恋
北恋 2020-11-22 01:08

When verbally talking about methods, I\'m never sure whether to use the word argument or parameter or something else. Either way the other people know what

30条回答
  •  广开言路
    2020-11-22 01:50

    Generally speaking, the terms parameter and argument are used interchangeably to mean information that is passed into a function.

    Yet, from a function's perspective:

    • A parameter is the variable listed inside the parentheses in the function definition.
    • An argument is the value that is sent to the function when it is called.

提交回复
热议问题