this.units는 정의되지 않았습니다. 이 값에 어떻게 접근합니까? 아니면이 모든 일을 다르게 설정할 것입니까? 어쩌면 너희들이 날 도울 수 있니? 사전객체 리터럴의 속성 값을 얻으십시오.
에서var calculator = calculator || {};
(function() {
calculator.sliderValues = {
applications: 42,
capacity: 140,
activeData: 30,
performance: 30,
virtualized: 100
}
calculator.overview = {
apps: {
HighPerformanceApps: {
units: Math.ceil(calculator.sliderValues.applications/100 * calculator.sliderValues.performance),
virtualized: calculator.sliderValues.virtualized < 81 ? 0 : this.units
}
}
}
})();
감사
컨텍스트에 대한 자세한 내용은 object' 창으로 참조하기 때문에 그것의, 그것은 도움이 될 것 console.log (this). – Todd