+ 3

Why it was not written like this :

operation=multiply() instead of this operation=multiply ??

5th Jun 2017, 1:33 PM
Darwin Cantong
Darwin Cantong - avatar
3 Answers
+ 3
operation = multyply() => this is the syntax to call a function. operation = multyply => this is the assignment, assing right side variable value to left side variable, in this case memory address of the multyply function.
5th Jun 2017, 2:47 PM
Eranga
Eranga - avatar
+ 1
The difference is, what data type operation has after these lines. The first line executes the multiply function and stores the result in operation. The second line does not execute the function but stores the function in operation. So after that second line you can call operation() as a function.
5th Jun 2017, 2:44 PM
merkrafter
0
can you show the code where you see this?
5th Jun 2017, 2:13 PM
LordHill
LordHill - avatar