You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: javascript1/week2/homework.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,7 @@ BUT people are asking: What will be the next product that truly defines Smart-ea
62
62
### Flight booking fullname function
63
63
64
64
Even for a startup as successful as Smart-ease there needs to be money in the bank. A customer from a flight booking website has asked for our help creating a specific part of their application:
65
+
65
66
When a user books a flight they **write their firstname and surname**, but when the ticket is printed a **fullname should be displayed**. It is our responsibility to create that.
66
67
67
68
Create a function called `getFullname` that returns a fullname.
@@ -71,9 +72,9 @@ It should have two parameters: `firstname` and `surname`.
Now try to create two variables `fullname1` and `fullname2` these two variables should be assigned to the return of calling the `getFullname` function.
75
+
Now try to create two variables `fullname1` and `fullname2` these two variables should be assigned to calling the `getFullname` function.
75
76
76
-
Log out the two fullnames.
77
+
Log out the two fullname variables.
77
78
78
79
#### Formal fullname
79
80
@@ -92,6 +93,8 @@ Remember to consider someone calling the function with an empty string as firstn
92
93
93
94
Try out your code by pasting your `getFullname` function in the javascript part of this codepen: https://codepen.io/hackyourfuture-cph/pen/jJWwbN
94
95
96
+
But what if the person is a woman? Describe how you would fix the `getFullname` so it also works for women
97
+
95
98
### Event application
96
99
97
100
Another customer has contacted us. He works for a secret company that rimes with foogle. The customer works on their calendar application. They need some functionality to help with writing what weekday an event is held.
@@ -110,7 +113,7 @@ console.log(getEventWeekday(2)); // Logs out "Sunday"
110
113
111
114
You should get the today's day from the system.
112
115
113
-
Hint: use remainder operator, array indexes and investigate new Date in js.
116
+
Hint: use remainder operator, array indexes and investigate `new Date` in js.
0 commit comments