So now, there's a quiz.
Our JavaScript interpreter is going to have to compute the value of 6 factorial,
a function call within a function call within a function call.
It's turtles all the way down.
How many different environment frames will be created by the interpreter for
factorial 6 above?
Include the global frame in your answer.
How many total environment frames will we be juggling at the same time?
Fill in the blank.
Question 2--In how many of those frames will n have the same value?
So if you could find 3 frames where n was 77, then the answer here would be 3.
さて小テストの時間です
JavaScriptインタプリタは6の階乗を計算します
関数呼び出しの中の関数呼び出しの中の
関数呼び出しです
どんどん積み重なっていきます
このような階乗計算ではどれだけの
異なる環境がインタプリタに作られますか?
答えの数にはグローバル環境も含めます
一度に合計何個の環境ができるか
空欄を埋めてください
次にいくつの環境でnが同じ値を持つか
答えてください
もし3つの環境でnが77だとしたら
答えは3になります
Então, agora, aqui está um teste.
Nosso interpretador JavaScript terá que computar o valor de factorial(6),
uma chamada de função dentro de uma chamada de função, dentro de uma chamada de função --
um caracol.
Quantos ambientes diferentes serão criados pelo interpretador para
factorial(6) acima?
Inclua o ambiente global na sua resposta.
Quantos ambientes, no total, estarão presentes ao mesmo tempo?
Preencha no espaço em branco.
Questão 2: em quantos desses ambientes n terá o mesmo valor?
Então, se você pudesse encontrar 3 ambientes onde n é 77, a resposta seria 3.