From db44e2d69f4c286109011985faf5252a4230d66d Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Fri, 25 Dec 2015 04:05:40 +0530 Subject: [PATCH] Quoting Strings with Single Quotes --- .../basic-javascript.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json index 3697f6e2cb..0555e4db32 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -893,17 +893,18 @@ "id": "56533eb9ac21ba0edf2244b4", "title": "Quoting Strings with Single Quotes", "description": [ - "Strings in Javascript may be declared with both 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.", + "String 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.", "\"This string has \\\"double quotes\\\" in it\"", - "The value in using one or the other has to do with the need to escape quotes of the same type. If you have a string with many double quotes, this can be difficult to write and to read. Instead, use single quotes:", - "'This string has \"double quotes\" in it'", + "The value in using one or the other has to do with the need to escape quotes of the same type. If you have a string with many double quotes, this can be difficult to read and write. Instead, use single quotes:", + "'This string has \"double quotes\" in it. And \"probably\" lots of them.'", "

Instructions

", "Change the provided string from double to single quotes and remove the escaping." ], "releasedOn": "11/27/2015", "tests": [ "assert(!/\\\\/g.test(editor.getValue()), 'message: Remove all the backslashes (\\)');", - "assert(editor.getValue().match(/\"/g).length === 4 && editor.getValue().match(/'/g).length === 2, 'message: You should have two single quotes ' and four double quotes "')" + "assert(editor.getValue().match(/\"/g).length === 4 && editor.getValue().match(/'/g).length === 2, 'message: You should have two single quotes ' and four double quotes "');", + "assert(myStr === 'Link', 'message: Only remove the backslashes \\ used to escape quotes.');" ], "challengeSeed": [ "var myStr = \"Link\";",