Play around with various kind of string manipulation capabilities in JavaScript.
- Mostly texts
- Concatination
- Upper case
- Lower case
- Title case
- Transformed texts
- Create some simple sentences that stored in different variables
- Those values inside those variables should not be changed
- If you want to create a new value, you should create a new variable
- Log those strings to the console
const sentenceA = "Hello World!"
const sentenceB = "Good Bye!"
console.log(sentenceA)
console.log(sentenceB)
- For all the programs you write in the following days, use concise comments and indentation to better serve your code
// This is a comment
/*
* Also a comment
* with multiple lines
*/
- Combine those different sentences into one sentence
const sentenceC = sentenceA + " " + sentenceB
- Try to use string template literals to save time
const sentenceD = `${sentenceA} ${sentenceB}`
- Again, log those strings to the console
- Transform all the characters of a string into different case of letters: uppercase and lowercase
Input example:
"Hello World"
"Good Bye"
Output example:
"HELLO WORLD"
"GOOD BYE"
- Transform all the characters of a string into title case
Input example:
"hello goodness"
Output example:
"Hello Goodness"
- You are free to change the value of your variables