Challenge: Using Literal Strings
Challenge yourself by updating the "getUserEvents" function to use string literal in place of string concatenation for API string.
We'll cover the following
Problem statement
In service methods like getUserEvents
, the API string is concatenated with the “ID” to create the full API string. Another method uses template literal strings. Without breaking any of the existing tests, see if you can update these API strings to template literals. (See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#syntax)
Playground
Below is your updated code. Modify it to implement the functionality mentioned in the problem statement.
Get hands-on with 1400+ tech skills courses.