Trying to understand something in JavaScript

Trying to understand something in JavaScript
0

#1

Hello everyone,

function timesFive(num) {
  return num * 5;
}
var answer = timesFive(5);

For what is that variable answer = ?
I can’t just only call the fuction with timesFive(5); like that?
It’s just for store the value in answer = and then you jsut can use it for something else?

Thank you


#2

Yes, by assigning the result of the function to answer, answer can be used somewhere else.


#3

Thank you for the answer! :hugs: