In this example, the greet()
function is invoked through sample.greet()
.
let sample = {
greet() {
console.log("hi")
}
}
How to invoke the inner greet()
function if defined like this?
function sample() {
function greet() {
console.log("hi")
}
}