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
The `addHobby` function receives two arguments, `hobby` en `hobbies` with the default value of the `hobbies` array on the `person` object.
4613
+
De functie `addHobby` ontvangt twee arguemnten, `hobby` en `hobbies` met als standaard waarde de waarde van de array `hobbies` op het object `person`.
4614
4614
4615
-
First, we invoke the `addHobby` function, en pass `"running"` as the value for `hobby` en an empty array as the value for `hobbies`. Since we pass an empty array as the value for `y`, `"running"` gets added to this empty array.
4615
+
Eerst roepen we de functie `addHobby` aan en geven `"running"` mee als de waarde voor `hobby`, en een lege array als de waarde voor `hobbies`. Omdat we een lege array meegeven als de waarde voor `y` wordt `"running"` toegevoegd aan deze lege array.
4616
4616
4617
-
Then, we invoke the `addHobby` function, en pass `"dancing"` as the value for `hobby`. We didn't pass a value for`hobbies`, so it gets the default value, the `hobbies`property on the`person`object. Wepush the hobby `dancing`to the `person.hobbies` array.
4617
+
Daarna roepen we de functie `addHobby` aan en geven `"dancing"` mee als de waarde voor `hobby`. We gaven geen waarde mee voor `hobbies` dus krijgt het de standaard waarde, de propertie `hobbies` op het object `person`. We pushen daar de hobby `dancing` naar de array `person.hobbies`.
4618
4618
4619
-
Last, we invoke the`addHobby`function, en pass `"bdaking"` as the value for `hobby`, en the `person.hobbies` array as the value for `hobbies`. We push the hobby `baking` to the `person.hobbies` array.
4619
+
Als laatste roepen we de functie `addHobby` aan en geven `"baking"` als de waarde voor `hobby` en de array `person.hobbies` als de waarde voor `hobbies`. We pushen de hobby `baking` naar de array `person.hobbies`.
4620
4620
4621
-
After pushing `dancing` en `baking`, the value of `person.hobbies` is `["coding", "dancing", "baking"]`
4621
+
Na het pushen van `dancing` en `baking` is de waarde van `person.hobbies` gelijk aan `["coding", "dancing", "baking"]`.
0 commit comments