mirror of
https://github.com/microsoft/Web-Dev-For-Beginners.git
synced 2025-08-11 17:24:24 +02:00
Merge pull request #930 from TejusWadbudhe/patch-1
Corrected grammar in explanation
This commit is contained in:
@@ -45,7 +45,7 @@ The if statement will run code in between its blocks if the condition is true.
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
if (condition){
|
if (condition){
|
||||||
//Condition was true. Code in this block will run.
|
//Condition is true. Code in this block will run.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ let currentMoney;
|
|||||||
let laptopPrice;
|
let laptopPrice;
|
||||||
|
|
||||||
if (currentMoney >= laptopPrice){
|
if (currentMoney >= laptopPrice){
|
||||||
//Condition was true. Code in this block will run.
|
//Condition is true. Code in this block will run.
|
||||||
console.log("Getting a new laptop!");
|
console.log("Getting a new laptop!");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -70,11 +70,11 @@ let currentMoney;
|
|||||||
let laptopPrice;
|
let laptopPrice;
|
||||||
|
|
||||||
if (currentMoney >= laptopPrice){
|
if (currentMoney >= laptopPrice){
|
||||||
//Condition was true. Code in this block will run.
|
//Condition is true. Code in this block will run.
|
||||||
console.log("Getting a new laptop!");
|
console.log("Getting a new laptop!");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
//Condition was false. Code in this block will run.
|
//Condition is false. Code in this block will run.
|
||||||
console.log("Can't afford a new laptop, yet!");
|
console.log("Can't afford a new laptop, yet!");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -101,11 +101,11 @@ let laptopPrice;
|
|||||||
let laptopDiscountPrice = laptopPrice - (laptopPrice * .20) //Laptop price at 20 percent off
|
let laptopDiscountPrice = laptopPrice - (laptopPrice * .20) //Laptop price at 20 percent off
|
||||||
|
|
||||||
if (currentMoney >= laptopPrice || currentMoney >= laptopDiscountPrice){
|
if (currentMoney >= laptopPrice || currentMoney >= laptopDiscountPrice){
|
||||||
//Condition was true. Code in this block will run.
|
//Condition is true. Code in this block will run.
|
||||||
console.log("Getting a new laptop!");
|
console.log("Getting a new laptop!");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//Condition was true. Code in this block will run.
|
//Condition is true. Code in this block will run.
|
||||||
console.log("Can't afford a new laptop, yet!");
|
console.log("Can't afford a new laptop, yet!");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user