<script>
let john = {
  name: "John",
  sayHi: function() {
    alert("Hi buddy!");
  }
};

alert(john.sayHi()); // Hi buddy!
</script>