Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions unicode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -103,3 +106,10 @@ console.log({
wordFromCodePoints,
swappedString,
});
//outputs are:

//firstCodePoint: 67,
//thirdCodePoint: 100,
//wordFromCodePoints: 'Hell',
//swappedString: 'hauncL'