diff --git a/unicode.js b/unicode.js index 1710ed5..d0f20a3 100644 --- a/unicode.js +++ b/unicode.js @@ -83,18 +83,20 @@ Assign the result to a variable named swappedString. */ -//Starter Code +// Starter Code // Task 1 let inputString1 = "Code"; -let firstCodePoint; // Your code here -let thirdCodePoint; // Your code here +let firstCodePoint = inputString1.charCodeAt(0); +let thirdCodePoint = inputString1.charCodeAt(2); // Task 2 -let wordFromCodePoints; // Your code here +let wordFromCodePoints = String.fromCharCode(74, 97, 118, 97, 83, 99, 114, 105, 112, 116); // Task 3 let inputString2 = "Launch"; -let swappedString; // Your code here +let firstChar = inputString2.charAt(0); +let lastChar = inputString2.charAt(inputString2.length - 1); +let swappedString = lastChar + inputString2.slice(1, inputString2.length - 1) + firstChar; // Log all results console.log({