Up to this point, I thought \"calling\" and \"invoking\" a function meant the same thing. However, in a YouTube tutorial it said to invoke a function by calling it.
Yes, in most cases we use both to refer the execution of a function.
There are 2 ways to reach place B from your HOME.
- Direct/Automatic way (Invoke), i.e. if you choose first way, you do not need to walk. Someone will automatically take you to place B.
- Indirect way (Call), i.e. if choose second way, you only need to reach A(by walk). Someone is there at place A to automatically take you to place B.
Have a look at the below image. I think it will clear your doubt.
In case of Calling, you originally refer to the statement that actually calls the function.
In case of Invoking, you indirectly refer to calling statement to actually invoke/run the function.