mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-21 00:21:35 +02:00
Merge branch 'master' into fix/ai-course-url
This commit is contained in:
@@ -15,3 +15,4 @@ function App() {
|
|||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
```
|
@@ -1,4 +1,4 @@
|
|||||||
Raw string literals in Go are enclosed in backticks (`` ` ``) and preserve all formatting exactly as written. This is different from interpreted string literals, which process escape sequences like \n. This distinction is particularly useful when you need to process data exactly as it is written.
|
Raw string literals in Go are enclosed in backticks (\`) and preserve all formatting exactly as written. This is different from interpreted string literals, which process escape sequences like \n. This distinction is particularly useful when you need to process data exactly as it is written.
|
||||||
|
|
||||||
Consider a scenario where you need to embed an HTML template directly into your Go code. With raw string literals, you can include the HTML exactly as written without worrying about escaping characters or preserving the formatting. For example:
|
Consider a scenario where you need to embed an HTML template directly into your Go code. With raw string literals, you can include the HTML exactly as written without worrying about escaping characters or preserving the formatting. For example:
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ htmlTemplate := `<!DOCTYPE html>
|
|||||||
<body>
|
<body>
|
||||||
<h1>Hello, World!</h1>
|
<h1>Hello, World!</h1>
|
||||||
</body>
|
</body>
|
||||||
</html>`
|
</html>` // backtick here ends the raw string literal
|
||||||
```
|
```
|
||||||
|
|
||||||
In this case, the raw string literal enclosed in backticks preserves newlines, tabs, and any other whitespace exactly as you write them.
|
In this case, the raw string literal enclosed in backticks preserves newlines, tabs, and any other whitespace exactly as you write them.
|
@@ -20,3 +20,4 @@ styleP.style.color = "red";
|
|||||||
styleP.style.border = "3px solid black";
|
styleP.style.border = "3px solid black";
|
||||||
|
|
||||||
console.log(styleP.style);
|
console.log(styleP.style);
|
||||||
|
```
|
@@ -2,21 +2,14 @@ Function scope refers to the scope of variables defined within a function. You c
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
function myStudyPlan() {
|
function myStudyPlan() {
|
||||||
|
var studyPlanOne = "Top JavaScript interview questions for web developers";
|
||||||
|
let studyPlanTwo = "Top JavaScript interview questions for web developers";
|
||||||
|
const studyPlanThree = "Top JavaScript interview questions for web developers";
|
||||||
|
|
||||||
var studyPlanOne = "Top JavaScript interview questions for web developers";
|
console.log(studyPlanOne);
|
||||||
|
console.log(studyPlanTwo);
|
||||||
let studyPlanTwo = "Top JavaScript interview questions for web developers";
|
console.log(studyPlanThree);
|
||||||
|
|
||||||
const studyPlanThree = "Top JavaScript interview questions for web developers";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
console.log(studyPlanOne);
|
|
||||||
|
|
||||||
console.log(studyPlanTwo);
|
|
||||||
|
|
||||||
console.log(studyPlanThree);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
myStudyPlan(); // Calls the function
|
myStudyPlan(); // Calls the function
|
||||||
|
```
|
@@ -14,3 +14,4 @@ Immediately invoked function expressions, or IIFEs, run as soon as they're creat
|
|||||||
"roadmap.sh helps prepare for JavaScript job interview questions"
|
"roadmap.sh helps prepare for JavaScript job interview questions"
|
||||||
);
|
);
|
||||||
})();
|
})();
|
||||||
|
```
|
@@ -25,3 +25,4 @@ export function studyJs(course) {
|
|||||||
import { studyJs } from './app.js';
|
import { studyJs } from './app.js';
|
||||||
|
|
||||||
console.log(studyJs("roadmap.sh")); // Read the JavaScript guide on, roadmap.sh
|
console.log(studyJs("roadmap.sh")); // Read the JavaScript guide on, roadmap.sh
|
||||||
|
```
|
@@ -31,3 +31,4 @@ console.log(courseNumber ); // code won't run
|
|||||||
}
|
}
|
||||||
|
|
||||||
strictExample(); // ReferenceError
|
strictExample(); // ReferenceError
|
||||||
|
```
|
32
src/data/question-groups/sql/content/where-vs-having.md
Normal file
32
src/data/question-groups/sql/content/where-vs-having.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
You use **WHERE** for filtering rows before applying any grouping or aggregation.
|
||||||
|
The code snippet below illustrates the use of **WHERE**. It filters the `Users` table for rows where the `Age` is greater than 18.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM Users
|
||||||
|
WHERE Age > 18;
|
||||||
|
```
|
||||||
|
|
||||||
|
The result of the query is similar to the table below.
|
||||||
|
|
||||||
|
| userId | firstName | lastName | age |
|
||||||
|
| ------ | --------- | -------- | --- |
|
||||||
|
| 1 | John | Doe | 30 |
|
||||||
|
| 2 | Jane | Don | 31 |
|
||||||
|
| 3 | Will | Liam | 25 |
|
||||||
|
| 4 | Wade | Great | 32 |
|
||||||
|
| 5 | Peter | Smith | 27 |
|
||||||
|
|
||||||
|
On the other hand, you use **HAVING** to filter groups after performing grouping and aggregation. You apply it to the result of aggregate functions, and it is mostly used with the **GROUP BY** clause.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT FirstName, Age FROM Users
|
||||||
|
GROUP BY FirstName, Age
|
||||||
|
HAVING Age > 30;
|
||||||
|
```
|
||||||
|
|
||||||
|
The code above selects the `FirstName` and `Age` columns, then groups by the `FirstName` and `Age`, and finally gets entries with age greater than 30. The result of the query looks like this:
|
||||||
|
|
||||||
|
| firstName | age |
|
||||||
|
| --------- | --- |
|
||||||
|
| Wade | 32 |
|
||||||
|
| Jane | 31 |
|
Reference in New Issue
Block a user