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
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>
<body>
<h1>LAB | JS Data Types</h1>
<br />
<br />
<br />
<p> Open the <a href="https://developer.chrome.com/docs/devtools/open/">Dev Tools console</a> to see the console output.</p>

Expand Down
44 changes: 33 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ const s2 = "fed";
const s3 = "Ted";
const s4 = "bread";
const s5 = "and";

// Fred fed Ted bread and Ted fed Fred bread
// Concatenate the string variables into one new string

const twister = (`${s1} ${s2} ${s3} ${s4} ${s5} ${s3} ${s2} ${s1} ${s4}`);

// Print out the concatenated string


console.log(twister);


/*******************************************
Iteration 1.2 | Camel Tail
*******************************************/
const part1 = "java";
const part2 = "script";
const part1 = "Java";
const part2 = "Script";

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

const final = part1.slice(0, -1) + part1.slice(-1).toUpperCase() + part2.slice(0, -1) + part2.slice(-1).toUpperCase();

// Print the cameLtaiL-formatted string


console.log(final);


/*******************************************
Expand All @@ -35,10 +35,10 @@ const part2 = "script";
const billTotal = 84;

// Calculate the tip (15% of the bill total)

const tipAmount = billTotal * 0.15;

// Print out the tipAmount

console.log(tipAmount);



Expand All @@ -48,10 +48,17 @@ const billTotal = 84;

// Generate a random integer between 1 and 10 (inclusive)

let randomDecimal = Math.random();

let scaled = randomDecimal * 10;

let randomNumber = Math.floor(scaled) + 1;

// Print the generated random number


console.log(randomNumber);


/*******************************************
Iteration 3.1 | Booleans
Expand All @@ -62,15 +69,30 @@ const b = false;

// Try and guess the output of the below expressions first and write your answers down:
const expression1 = a && b;
console.log("expression1", expression1);

const expression2 = a || b;
console.log("expression2", expression2);

const expression3 = !a && b;
console.log("expression3", expression3);

const expression4 = !(a && b);
console.log("expression4", expression4);

const expression5 = !a || !b;
console.log("expression5", expression5);

const expression6 = !(a || b);

const expression7 = a && a;
console.log("expression6", expression6);

const expression7 = a && a;
console.log("expression7", expression7);

// false
//true
//false
// true
//true
//false
//true