<!DOCTYPE html>
<html>
<body>
<h2>JavaScript関数</h2>
<p>この例では、person1 で使用して person の fullName メソッドを呼び出します。
</p>
<p id="demo"></p>
<script>
const person = {
fullName: function(city, country) {
return this.firstName + " " + this.lastName + "," + city + "," + country;
}
}
const person1 = {
firstName:"John",
lastName: "Doe"
}
const person2 = {
firstName:"Mary",
lastName: "Doe"
}