Skip to content

Instantly share code, notes, and snippets.

@roshnet
Created July 26, 2020 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roshnet/233c3cc7976dbbc6ff104edecdb32eae to your computer and use it in GitHub Desktop.
Save roshnet/233c3cc7976dbbc6ff104edecdb32eae to your computer and use it in GitHub Desktop.
function placeOrder(user) {
var order;
order.buyer = user;
order.itemName = 'Raspberry Pi';
order.itemPrice = 2500;
order.isConfirm = true;
return order;
}
var person = {
name: 'John',
isFrequentVisitor: false
};
var newOrder = placeOrder(person);
if (newOrder.isConfirm) {
console.log('The order has been confirmed. Check details below:');
console.log(newOrder);
}
else {
console.log('The order has not been confirmed yet.');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment