From 07e7c3311de5cffa845d0e499df5cda1608ffeb6 Mon Sep 17 00:00:00 2001 From: poonamwaghode Date: Fri, 14 Mar 2025 14:17:27 -0500 Subject: [PATCH] Update unicode.js --- unicode.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/unicode.js b/unicode.js index 019b581..099f8a9 100644 --- a/unicode.js +++ b/unicode.js @@ -86,15 +86,20 @@ Assign the result to a variable named swappedString. //Starter Code // Task 1 let inputString1 = "Code"; -let firstCodePoint; // Your code here -let thirdCodePoint; // Your code here +let firstCodePoint; // let firstCodePoint = inputString.charCodeAt(0); // Unicode of 'C' + +let thirdCodePoint; // let thirdCodePoint = inputString.charCodeAt(2); // Unicode of 'd' // Task 2 -let wordFromCodePoints; // Your code here +let wordFromCodePoints; // let wordFromCodePoints = String.fromCharCode(72, 101, 108, 108); // Task 3 let inputString2 = "Launch"; -let swappedString; // Your code here +let swappedString; //let swapString = "Launch"; + //let firstCharCode = swapString.charCodeAt(0); // Unicode of 'L' + //let lastCharCode = swapString.charCodeAt(swapString.length - 1); // Unicode of 'h' + + //let swappedString = String.fromCharCode(lastCharCode) + swapString.slice(1, -1) + String.fromCharCode(firstCharCode); // Log all results console.log({