fix(challenges): Improve wording of description (#15873)
changed the description of the challenge to make campers understand the task better Closes #14306
This commit is contained in:
parent
89b23669d0
commit
fbce073fb2
@ -1080,13 +1080,17 @@
|
||||
"id": "56533eb9ac21ba0edf2244b4",
|
||||
"title": "Quoting Strings with Single Quotes",
|
||||
"description": [
|
||||
"<dfn>String</dfn> values in JavaScript may be written with single or double quotes, so long as you start and end with the same type of quote. Unlike some languages, single and double quotes are functionally identical in JavaScript.",
|
||||
"<blockquote>\"This string has \\\"double quotes\\\" in it\"</blockquote>",
|
||||
"The value in using one or the other has to do with the need to <dfn>escape</dfn> quotes of the same type. Unless they are escaped, you cannot have more than one pair of whichever quote type begins a string.",
|
||||
"If you have a string with many double quotes, this can be difficult to read and write. Instead, use single quotes:",
|
||||
"<blockquote>'This string has \"double quotes\" in it. And \"probably\" lots of them.'</blockquote>",
|
||||
"<dfn>String</dfn> values in JavaScript may be written with single or double quotes, as long as you start and end with the same type of quote. Unlike some other programming languages, single and double quotes work the same in JavaScript.",
|
||||
"<blockquote>doubleQuoteStr = \"This is a string\"; <br/>singleQuoteStr = 'This is also a string';</blockquote>",
|
||||
"The reason why you might want to use one type of quote over the other is if you want to use both in a string. This might happen if you want to save a conversation in a string and have the conversation in quotes. Another use for it would be saving an <code><a></code> tag with various attributes in quotes, all within a string.",
|
||||
"<blockquote>conversation = 'Finn exclaims to Jake, \"Algebraic!\"';</blockquote>",
|
||||
"However, this becomes a problem if you need to use the outermost quotes within it. Remember, a string has the same kind of quote at the beginning and end. But if you have that same quote somewhere in the middle, the string will stop early and throw an error.",
|
||||
"<blockquote>goodStr = 'Jake asks Finn, \"Hey, let\\'s go on an adventure?\"'; <br/>badStr = 'Finn responds, \"Let's go!\"'; // Throws an error</blockquote>",
|
||||
"In the <dfn>goodStr</dfn> above, you can use both quotes safely by using the backslash <code>\\</code> as an escape character.",
|
||||
"<strong>Note</strong><br/>The backslash <code>\\</code> should not be be confused with the forward slash <code>/</code>. They do not do the same thing.",
|
||||
"<hr>",
|
||||
"Change the provided string from double to single quotes and remove the escaping. Do not change anything else."
|
||||
"Change the provided string to a string with single quotes at the beginning and end and no escape characters.",
|
||||
"Right now, the <code><a></code> tag in the string uses double quotes everywhere. You will need to change the outer quotes to single quotes so you can remove the escape characters."
|
||||
],
|
||||
"releasedOn": "January 1, 2016",
|
||||
"challengeSeed": [
|
||||
|
Loading…
x
Reference in New Issue
Block a user