Update Pickup Point
Given a previous pickup point in the prefilled code, and updated pickup point
<!DOCTYPE html>
<html>
<head>
<script>
function createPickupPoint(area, city) {
return {
area: area,
city: city,
getPickupPoint() {
// updated pickup point area and city separated by a space
return area + ' ' + city;
}
}
}
//The first line of input contains a string area
var area = prompt("Enter the area: ");
//The second line of input contains a string city
var city = prompt("Enter the city: ");
var pickupPoint = createPickupPoint(area, city)
console.log(pickupPoint.getPickupPoint());
</script>
</head>
<body>
</body>
</html>
Comments
Leave a comment