Skip to content

Commit 25768ef

Browse files
committed
Enhance explanations and examples
1 parent 3da742f commit 25768ef

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Sprint-1/4-stretch-explore/chrome.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ In the Chrome console,
1111
invoke the function `alert` with an input string of `"Hello world!"`;
1212

1313
What effect does calling the `alert` function have?
14+
An alert message displays in chrome, the content of the message is the webpage or the website says the string i typed in an alert way.
1415

1516
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`.
1617

1718
What effect does calling the `prompt` function have?
19+
It allows you to input a value in box the browser displays, in this example myName was assigned using = with a value i inputted after running the code.
20+
1821
What is the return value of `prompt`?
22+
The string you input in the field. but after looking more into it,
23+
there is an edge case where the user can click cancel in this situation the return value is null which means absences of value.

Sprint-1/4-stretch-explore/objects.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,27 @@ In this activity, we'll explore some additional concepts that you'll encounter i
55
Open the Chrome devtools Console, type in `console.log` and then hit enter
66

77
What output do you get?
8+
console.log
9+
ƒ log() { [native code] }
10+
ƒ stands for "function"
11+
[native code] part just means it's a function built in so we can't see the actual underlying JavaScript code for it.
812

913
Now enter just `console` in the Console, what output do you get back?
14+
console
15+
console {debug: ƒ, error: ƒ, info: ƒ, log: ƒ, warn: ƒ, …}
16+
I think it gives a options of methods i can use with the object console.
1017

1118
Try also entering `typeof console`
19+
typeof console
20+
'object'
21+
from the name i can understand that typeof tells you the variable type so for console its object type.
1222

1323
Answer the following questions:
1424

1525
What does `console` store?
26+
It stores a collection of methods.
27+
1628
What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
29+
It means that i want to use a method (e.g. `log` or `assert`) that belong to an object (e.g. `console`)
30+
`.` is dot notation, it means get the method from the object.
31+

0 commit comments

Comments
 (0)