Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
46 changes: 37 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@ const s3 = "Ted";
const s4 = "bread";
const s5 = "and";



// Concatenate the string variables into one new string

let tongueTwister;

// Print out the concatenated string
let firstPhrase = s1.concat(" ", s2," ", s3, " ",s4," ",s5, " ");
let secondPhrase = s3.concat(" ", s2," ", s1, " ",s4);

tongueTwister = firstPhrase += secondPhrase;


// Print out the concatenated string

console.log(tongueTwister)


/*******************************************
Expand All @@ -23,9 +32,18 @@ const part2 = "script";

// Convert the last letter of part1 and part2 to uppercase and concatenate the strings

let cameLtaiL;

let wordOne = part1.slice(0,3) + part1.toUpperCase().slice(3);
let wordTwo = part2.charAt(0).toUpperCase() + part2.slice(1);


cameLtaiL = wordOne + wordTwo ;


// Print the cameLtaiL-formatted string

console.log(cameLtaiL)



Expand All @@ -35,11 +53,13 @@ const part2 = "script";
const billTotal = 84;

// Calculate the tip (15% of the bill total)
let tip = (84 * 15) / 100;

tipAmount = tip;

// Print out the tipAmount


console.log(tipAmount)


/*******************************************
Expand All @@ -49,8 +69,16 @@ const billTotal = 84;
// Generate a random integer between 1 and 10 (inclusive)




// Print the generated random number

function RandomNum(num) {
return Math.floor(Math.random(0 >=10) * num);
}

console.log(RandomNum(10));



/*******************************************
Expand All @@ -61,16 +89,16 @@ const a = true;
const b = false;

// Try and guess the output of the below expressions first and write your answers down:
const expression1 = a && b;
const expression1 = a && b; //true because the are of the same value

const expression2 = a || b;
const expression2 = a || b; //true because they both are letters

const expression3 = !a && b;
const expression3 = !a && b; //false bacuse 'a' is false

const expression4 = !(a && b);
const expression4 = !(a && b); //false

const expression5 = !a || !b;
const expression5 = !a || !b; //true because they both are false

const expression6 = !(a || b);
const expression6 = !(a || b); //true because they both are letters

const expression7 = a && a;
const expression7 = a && a; //true because there are the same letter