Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (25 sloc) 479 Bytes
**question
What gets logged to the console for the second call to calculate?
**question
**code
function calculate(input){
if (calculate.cache[input]){
console.log('from cache');
return calculate.cache[input];
}
console.log('not cached');
return calculate.cache[input] = Math.pow(input, 3);
}
calculate.cache = {};
calculate(5);
calculate(5);
**code
**possibleAnswers
'not cached'
'from cache'
undefined
null
**possibleAnswers
**correctIndex
1
**correctIndex
Something went wrong with that request. Please try again.