Skip to content
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

first commit #435

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
2 changes: 2 additions & 0 deletions 01-Fundamentals-Part-1/starter/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@
</head>
<body>
<h1>JavaScript Fundamentals – Part 1</h1>

<script src="script.js"></script>
</body>
</html>
20 changes: 20 additions & 0 deletions 01-Fundamentals-Part-1/starter/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const firstName = "Jonas";
const job="teacher";
const birthyear=1991;
const year=2037;
const jonas = "I'm " + firstName + ',a ' + (year-birthyear) +' years old ' +job
//template literals
const jonasNew = `I'm ${firstName},
a ${year-birthyear}
years old ${job}`
console.log(jonas);
console.log(jonasNew);
//decisions
const age=15;
const isOldEnough=age>=18; //if the age is 18 or older then it is true
isOldEnough ? console.log("Sarah can start driving license 🚗") : console.log(`Sarah is too young. Wait another ${18 - age} years :)`);
const birthYear=1991;
let century;
century = birthYear <= 2000 ? 20 : 21;
console.log(century)
//type conversion
24 changes: 12 additions & 12 deletions 02-Fundamentals-Part-2/starter/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>JavaScript Fundamentals – Part 2</title>
<style>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>JavaScript Fundamentals – Part 2</title>
<style>
body {
height: 100vh;
display: flex;
Expand All @@ -21,10 +21,10 @@
text-align: center;
color: white;
}
</style>
</head>
<body>
<h1>JavaScript Fundamentals – Part 2</h1>
<script src="script.js"></script>
</body>
</style>
</head>
<body>
<h1>JavaScript Fundamentals – Part 2</h1>
<script src="script.js"></script>
</body>
</html>