From f1ef10aeb0b68804f7653c05d9daebfb6fa2a9fe Mon Sep 17 00:00:00 2001 From: Resurreccion Date: Tue, 15 Jan 2019 14:52:33 -0800 Subject: [PATCH] replace stub with guide (#33670) --- .../understand-string-immutability/index.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/guide/english/certifications/javascript-algorithms-and-data-structures/basic-javascript/understand-string-immutability/index.md b/guide/english/certifications/javascript-algorithms-and-data-structures/basic-javascript/understand-string-immutability/index.md index 4bdae9338f..a98959189b 100644 --- a/guide/english/certifications/javascript-algorithms-and-data-structures/basic-javascript/understand-string-immutability/index.md +++ b/guide/english/certifications/javascript-algorithms-and-data-structures/basic-javascript/understand-string-immutability/index.md @@ -3,8 +3,19 @@ title: Understand String Immutability --- ## Understand String Immutability -This is a stub. Help our community expand it. +## Problem Explanation +Correct the assignment to ```myStr``` so it contains the string value of ```Hello World``` using the approach shown in the example above. -This quick style guide will help ensure your pull request gets accepted. +## Hint +Instead of ```Jello World ```, ```myStr``` should be assigned ```Hello World```. - + ## Spoiler Alert! Solution ahead. +**Solution** +```javascript +// Setup +var myStr = "Jello World"; + // Only change code below this line + myStr = "Hello World"; +``` + ## Code Explanation +String literals such as ```"Jello World"``` cannot be changed by the individual letter (hence being *immutable*), so the variable containing the incorrect string must be replaced with the desired string using the assignment operator ```=```