#Day29 — From Python to JavaScript — The Basics Part 2
Published in
4 min readApr 19, 2021
In yesterday’s article, we discussed the following
- Why you should learn JavaScript
- How to Run JavaScript/Python and show output
- Variables
- Comments
Today, we will talk about the following
- Conditional Statements
- Blocks
- Comparison Operators
- Logical Operators
- Truthy and Falsy Values
- Ternary Operators
- Switch Cases
Conditional Statements
Python
Python supports the following
- if statements
- else statements
- elif statements Below is an example
num = 10if num > 20:
print("If statement")
elif num > 10:
print("Elif statement")
else:
print("Else statement")
Let’s try writing the same code snippet in JavaScript
JavaScript
JavaScript supports the following
- if statements
- else statements
- else if statements —…