Using the syntax of es6, how to assign a function to a property of a custom data type?

define a function first

function say(){
    alert("Hi!");
}

define another custom data type

class Dog{
    constructor(name){
        this.name = name;
    }
    //saysay
    say  ???
}
May.22,2021

function say(){
    alert('Hi!');
}
class Dog{
    constructor(name){
        this.name = name;
    }
    
  say(){
    return say.prototype.constructor;
    }
}
new Dog().say()();
Menu