-
-
Notifications
You must be signed in to change notification settings - Fork 337
Sheffield | ITP-Jan-26 | Hayriye Saricicek | Sprint 1 | Structuring and Testing Data #1126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 16 commits
54a88fb
4c84db9
f60234b
e49b1fc
fc3d35e
578f816
cfe1b0c
3b76794
122b382
705d9fb
28d4987
f94b1e6
ffee9e4
90e2625
4a031a0
b67539e
ae3854e
46171e4
c23bfd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| This is just an instruction for the first activity - but it is just for human consumption | ||
| We don't want the computer to run these 2 lines - how can we solve this problem? | ||
| //This is just an instruction for the first activity - but it is just for human consumption | ||
| //We don't want the computer to run these 2 lines - how can we solve this problem? | ||
| //putting two forward slashes at the start of the line makes it a comment, which means the computer will ignore it when running the program |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // trying to create an age variable and then reassign the value by 1 | ||
|
|
||
| const age = 33; | ||
| //const age = 33; needs to be let or the value cannot be reassigned | ||
| let age = 33; | ||
| age = age + 1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| // Currently trying to print the string "I was born in Bolton" but it isn't working... | ||
| // what's the error ? | ||
|
|
||
| console.log(`I was born in ${cityOfBirth}`); | ||
| //console.log(`I was born in ${cityOfBirth}`); | ||
| //const cityOfBirth = "Bolton"; | ||
| // these are in the wrong order. Cannot access the value of cityOfBirth before it has been declared. Need to declare the variable first and then log it to the console. | ||
|
|
||
| const cityOfBirth = "Bolton"; | ||
| console.log(`I was born in ${cityOfBirth}`); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| const 12HourClockTime = "20:53"; | ||
| const 24hourClockTime = "08:53"; | ||
| const 24hourClockTime = "08:53"; | ||
| // variable names cannot begin with a number | ||
| // can change to clockTime12Hour and clockTime24Hour or something similar to make it valid |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,8 +11,21 @@ In the Chrome console, | |
| invoke the function `alert` with an input string of `"Hello world!"`; | ||
|
|
||
| What effect does calling the `alert` function have? | ||
| a pop up box appears saying thecharitych.com says this is an alert | ||
|
|
||
| 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`. | ||
|
|
||
| What effect does calling the `prompt` function have? | ||
| a pop up box appears saying thecharitych.com says What is your name | ||
|
|
||
| What is the return value of `prompt`? | ||
|
|
||
| Using: | ||
| const myName = prompt("What is your name?"); | ||
| console.log(myName); | ||
|
|
||
| If I click ok without entering my name the prompt goes off the screen and console.log returns undefined | ||
|
|
||
| If I click cancel without entering my name the promptgoes off the screen and console.log null undefined | ||
|
|
||
| If I put my name Hayriye in and click ok then it goes off the screen and console.log returns Hayriye | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are all good test cases and observation. Notes:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have changed the markdown to ticks. |
||
Uh oh!
There was an error while loading. Please reload this page.