From 95d7c25679660fceab72355ea7a9ad22284215bb Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Fri, 25 Dec 2015 16:29:13 +0530 Subject: [PATCH] Understand String Immutability --- .../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 7d759f07d9..d68cba9f4e 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -1188,10 +1188,11 @@ "id": "56533eb9ac21ba0edf2244ba", "title": "Understand String Immutability", "description": [ - "In Javascript, strings are immutable, which means that they cannot be changed or modified once created. For example, this code:", - "var myStr = \"Bob\";
myStr[0] = \"J\";
", - "will not change the contents of myStr to \"Job\", because the contents of myStr cannot be altered. Note that this does not mean that myStr cannot be change, just that individual characters cannot be changes. The only way to change myStr would be to overwrite the contents with a new string, like this:", - "var myStr = \"Bob\";
myStr = \"Job\";
", + "In Javascript, String values are immutable, which means that they cannot be altered once created.", + "For example, the following code:", + "
var myStr = \"Bob\";
myStr[0] = \"J\";
", + "cannot change the value of myStr to \"Job\", because the contents of myStr cannot be altered. Note that this does not mean that myStr cannot be changed, just that the individual characters of a string literal cannot be changed. The only way to change myStr would be to assign it with a new string, like this:", + "
var myStr = \"Bob\";
myStr = \"Job\";
", "

Instructions

", "Correct the assignment to myStr to achieve the desired effect." ],