Back
Close

Ceaser Cipher

Adriaan
3,144 views

Working with text

In this activity, we will be working with text values. In JavaScript, text values are stored in a String Data Type.

Learn more about the String Data Type here

Strings are declared using the " ' or `respectively.

For example, to create a String variable called name, we use the following code:

let name = "John";

or to declare a String constant called country, we use the following code:

const country = "Germany";

Now, for our caesar cipher decryption program, we will need to store our message and all the letters in our alphabet as Strings. In the code below, create a variable called message and set it to hello and a constant called ALPHABET (note the capitals!) set it to abcdefghijklmnopqrstuvwxyz

Your turn
// Enter your code here
// { autofold
module.exports = { alphabet: ALPHABET, message: message };
//
// }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants