课程: JavaScript Essential Training
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Assignment vs. comparison
- [Instructor] You've probably noticed in JavaScript, the equal symbol is not used the same way we use it in math. In JavaScript, the equal symbol means assignment. The value on the right side is assigned to the container on the left. Anytime you see a single equal symbol, it's an assignment of a value to a variable. We also use equal symbols for comparison and that's what you see down here. We have two equal symbols next to one another, And that says, we're looking to see if the value of A equals the value of B. Are they the same or not? This code example in the exercise files is a really basic example to demonstrate how these different comparisons work. What we're doing here is just assigning a value to A and B and then we're console logging out, what the values are and also the type of data that's inside, each of these variables. Why we're doing that will become apparent in the second. Then we use a basic conditional…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
-
-
Variables: Containers for everything2 分钟 31 秒
-
(已锁定)
Var3 分钟 15 秒
-
(已锁定)
Scope3 分钟 37 秒
-
(已锁定)
Let4 分钟 34 秒
-
(已锁定)
Const2 分钟 58 秒
-
(已锁定)
Data types3 分钟 7 秒
-
(已锁定)
Assignment vs. comparison4 分钟 35 秒
-
(已锁定)
Math operators6 分钟 13 秒
-
(已锁定)
Challenge intro: Calculate sales tax1 分钟 35 秒
-
(已锁定)
Solution: Calculate sales tax3 分钟 30 秒
-
-
-
-
-
-