2
var Higher = {
hello: function(){
console.log('Hello from Higher');
}
Lower: {
hi: function(){
//how to call the 'hello()' method from the Higher namespace?
//without hardcoding it, as 'Higher.hello()'
console.log('Hi from Lower');
}
}
}
하드 코딩없이 상위 네임 스페이스에서 메소드를 호출하는 방법은 무엇입니까? 다른 하위 네임 스페이스에서 상위 수준 네임 스페이스의 메서드를 호출하려는 위치의 주석을 참조하십시오.자바 스크립트 객체의 상위 네임 스페이스에 액세스하십시오.