-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0.js
More file actions
13 lines (10 loc) · 618 Bytes
/
0.js
File metadata and controls
13 lines (10 loc) · 618 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
// Predict and explain first...
// Missing backticks for template string template strings need to use backticks `, but here ${} is used without them
// call the function capitalise with a string input (error)
// interpret the error message and figure out why an error is occurring
// ${} must be inside backticks and str is being redeclared (it is already the function parameter)
// =============> write your explanation here
// =============> This function takes a string and returns a new string with the first letter in capital
function capitalise(str) {
return `${str[0].toUpperCase()}${str.slice(1)}`;
}