var robotDeparture = "The robot has set off to buy milk!"
var farewellRobot = return robotDeparture;
I'm attempting to show the content of the robotLeaves variable using a return statement. Furthermore, I intend to assign this return statement to a variable so that I can use it again.
Can anyone recommend websites or resources where I could find information on how to achieve this?
edit: Below is the complete code I am testing:
function getMilk() {
var shop = 10;
var robotDeparts = "The robot has left to get milk!";
var robotReturns = "The robot has returned with 1 bottle of milk!";
var farewellRobot = return robotDeparture;
farewellRobot;
if(farewellRobot) {
--shop;
return robotReturns;
return shop;
};
}
getMilk();
2nd edit: It appears that I was utilizing the return statement incorrectly! Appreciations to those who provided input!