Skip to content

Commit 373e8ae

Browse files
Complete sprint 2 coursework
1 parent 837636d commit 373e8ae

7 files changed

Lines changed: 40 additions & 1 deletion

File tree

‎Sprint-2/4-stretch-explore/chrome.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ Let's try an example.
88
In the Chrome console, invoke the function `alert` with one argument, the string `"Hello world!"`;
99

1010
What effect does calling the `alert` function have?
11+
alert(): shows the message to the users. in this case show "Hello world!" in the box and we can close it or click on the ok.
1112

1213
Now try invoking the function `prompt` with a string input of `"What is your name?"` - store the return value of your call to `prompt` in an variable called `myName`.
1314

14-
What effect does calling the `prompt` function have?
15+
What effect does calling the `prompt` function have?
16+
prompt(): returns whatever the user enters. It is provide a textbox that we can type on it.
1517
What is the return value of `prompt`?
18+
The Return value of prompt is the text enter by user. in this example return name that we write in the box.

‎prep/errortest.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log (math.round(10.3);

‎prep/facts.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("It take two days to find how to choose Need reviews in PR just because a simple mistake.");

‎prep/greeting.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
console.log("hello" === "hello");
2+
console.log("CYF" === "cyf");
3+
const homeTown = "Newcastle"
4+
console.log(homeTown === "liverpool");
5+
console.log(42 === 42);
6+
console.log(42 !== "42")

‎prep/hello_world.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Hello world!");

‎prep/passwordChecker.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const password = "secretword123";
2+
const userInput = "thisiswrong";
3+
const adminPassword = "override";
4+
let response = "";
5+
6+
if (userInput === password){
7+
response = "Correct password entered";
8+
} else if (userInput === adminPassword){
9+
response = "Admin access granted";
10+
} else {
11+
response = "Incorrect password!";
12+
}
13+
14+
console.log(response);

‎prep/sprint-2/notes.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Sprint 2 Notes
2+
3+
## Things I have learned
4+
5+
*
6+
7+
## Commands I have used
8+
9+
*
10+
11+
## JavaScript
12+
13+
*

0 commit comments

Comments
 (0)