Skip to content

lab js data types #619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
20 changes: 10 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LAB | JS Data Types</title>
<meta charset="UTF-8">
<title>lab-js-data-types</title>


</head>
<body>
<h1>LAB | JS Data Types</h1>
<br />
<br />
<p> Open the <a href="https://developer.chrome.com/docs/devtools/open/">Dev Tools console</a> to see the console output.</p>
<!-- partial:index.partial.html -->

<!-- partial -->
<script src="./script.js"></script>

<script src="index.js"></script>
</body>
</html>
</html>
76 changes: 0 additions & 76 deletions index.js

This file was deleted.

63 changes: 63 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Iteration 1
const s1 = "Fred";
const s2 = "fed";
const s3 = "Ted";
const s4 = "bread";
const s5 = "and";

const text = `${s1} ${s2} ${s3} ${s5} ${s3} ${s2} ${s1} ${s4}`;
// "Fred fed Ted bread and Ted fed Fred bread".

console.log(text);

// Itertation 2
const part1 = "java";
const part2 = "script";

const part1new = part1.slice(0,-1) + part1.slice(-1).toUpperCase()

const part2new = part2.slice(0,-1) + part2.slice(-1).toUpperCase()

const cameLCase = part1new + part2new

console.log(cameLCase)

// Itration 3

const billTotal = 84;

const tipAmount = billTotal * 0.15

console.log(tipAmount)

// Iteration 4
const max = 10
const randomNumber = Math.floor(Math.random() * max)

console.log(randomNumber)

// Iteration 5
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; // false
console.log(expression1)

const expression2 = a || b; // true
console.log(expression2)

const expression3 = !a && b; // false
console.log(expression3)

const expression4 = !(a && b); // true
console.log(expression4)

const expression5 = !a || !b; // true
console.log(expression5)

const expression6 = !(a || b); // false
console.log(expression6)

const expression7 = a && a; // true
console.log(expression7)