-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from hanfamilym1/snippet/buttonClick
Button function changed to return array
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Learning Entry - 2023-10-16 | ||
|
||
## Type of Learning: Snippet | ||
|
||
### What I've Learned: | ||
|
||
I got this from stackoverflow [link](https://stackoverflow.com/questions/65271151/how-do-i-fix-my-button-not-working-in-html) | ||
|
||
I changed qtwo function to meet my needs: | ||
- return an array | ||
|
||
``` | ||
function qtwo() { | ||
var text = ""; | ||
var numyrs = prompt("How many years do you want to go back in time?"); | ||
console.log(numyrs); | ||
switch (numyrs) { | ||
case "2019": | ||
text = "Scientists release first-ever image of black hole." | ||
break; | ||
case "2018": | ||
text = "The United States Leaves the Iran Nuclear Deal." | ||
break; | ||
default: | ||
text = ""; | ||
break; | ||
} | ||
// changed | ||
function qtwo() { | ||
return [] | ||
} | ||
``` | ||
|
||
[Write here what you've learned during your study, experiment, or exploration. Be as detailed and informative as possible.] |