Let's go through it together.
1 plus blank equals 2, this is pretty much just 1. 1 plus 1 equals 2.
Just like in Python, JavaScript supports string concatenation using addition.
I didn't tell you about this explicitly, but I did tell you to use your Python intuition.
We're going to fill in this blank with one as well,
but this one is a string O-N-E.
The string P-H plus the string O-N-E will equal the string P-H-O-N-E.
Over here this is perhaps the trickiest on the screen.
In order for this whole expression to be True,
both of these sub-expressions,
both of these conjuncts if you prefer mathematics have to be true.
X must be equal to 8 and this complicated math over here must also be true.
Well, if x is equal to 8 then x divided by 2 is 4.
X divided by 2 equals 4 should return True.
This'll be true on the left and true on the right.
Finally, over here, what's anything that we could put in this blank that would
possibly make this expression turn true? J\ust write out the Boolean constant True.
では見ていきます
1+空欄==2なので1が入ります 1+1==2
Pythonと同じようにJavaScriptも+を使って
文字列を連結できます
これについてはっきりとは伝えていませんでしたが
Pythonの直観を使うようにとは言いましたね
この空欄にも1を意味する言葉が入ります
文字列のoneです
文字列のphとoneを連結するとphoneになります
次がおそらく最も手ごわいと思います
この式全体をTRUEにするために
両辺にある部分式が
式の両辺がTRUEでなければいけません
数学的には論理積といいます
xは8と等しく かつ
この複雑な計算式もTRUEでなければいけません
xが8ならば2で割ったものは4です
ゆえにx/2==4はTRUEと返されます
左辺も右辺もTRUEになります
最後の空欄を埋めて
式をTRUEにするものは何でしょうか?
ブール定数のTRUEを入れればいいですね
Vamos resolver juntos.
1 + espaço == 2 -- isso é fácil: simplesmente 1 -- 1 + 1 == 2.
Assim como em Python, JavaScript provê suporte a concatenação de strings usando adição.
Eu não falei isso explicitamente, mas disse a você para usar sua intuição sobre Python.
Vamos preencher este espaço com "one" também,
mas agora com o string "one".
O String "ph" + o string "one" é igual ao string "phone".
Este aqui é talvez o mais difícil.
Para que a expressão toda seja TRUE,
essas duas subexpressões --
os 2 termos da conjunção -- devem ser TRUE.
x deve ser igual a 8 e essa expressão matemática aqui deve também ser verdadeira.
Bem, se x == 8, então x/2 == 4.
x/2 == 4 deve retornar TRUE --
isso será TRUE à esquerda e TRUE à direita.
Finalmente, aqui, o que poderíamos colocar neste espaço em branco de modo que
essa expressão retorne TRUE? Pode ser simplesmente a constante booleana TRUE.