From 37d491ca6159b02e44c1729d4d0e3e32345a8a2d Mon Sep 17 00:00:00 2001 From: EbenAngeline Date: Tue, 21 Apr 2026 11:06:49 -0500 Subject: [PATCH] unicode.js --- unicode.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/unicode.js b/unicode.js index 1710ed5..6421fa7 100644 --- a/unicode.js +++ b/unicode.js @@ -86,15 +86,18 @@ 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 = inputString1.charCodeAt(0); // Your code here +let thirdCodePoint = inputString1.charCodeAt(2); // Your code here // Task 2 -let wordFromCodePoints; // Your code here +let wordFromCodePoints = String.fromCharCode(72,101,108,108); // Your code here // Task 3 let inputString2 = "Launch"; -let swappedString; // Your code here +let firstCharcode = inputString2.charCodeAt(0); +let lastCharcode = inputString2.charCodeAt(5); // Your code here +let middleCharcode = inputString2.substring(1,5); // Your code here +let swappedString = String.fromCharCode(lastCharcode) + middleCharcode + String.fromCharCode(firstCharcode); // Your code here // Log all results console.log({ @@ -103,3 +106,10 @@ console.log({ wordFromCodePoints, swappedString, }); +//outputs are: + +//firstCodePoint: 67, + //thirdCodePoint: 100, + //wordFromCodePoints: 'Hell', + //swappedString: 'hauncL' +