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

my trainings during video #447

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
Binary file added .DS_Store
Binary file not shown.
Binary file added 01-Fundamentals-Part-1/.DS_Store
Binary file not shown.
112 changes: 112 additions & 0 deletions 01-Fundamentals-Part-1/assignment/assignment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
// // let country = 'United Arab Emirates'
// // let continent = 'MEA'
// // let population = '4 Million'


// // console.log(country)
// // console.log(continent)
// // console.log(population)


// // let javascriptIsFun = true;
// // console.log(javascriptIsFun);


// // console.log(typeof javascriptIsFun);
// // console.log(typeof country)
// // console.log(typeof 23)
// // console.log(typeof "faizan")
// // console.log(typeof faizan)

// // let year;
// // console.log(typeof year)
// // year = 1991;
// // console.log(typeof year)

// // console.log(typeof null)

// // const now = new Date().getUTCFullYear();

// // console.log(now)
// // const ageFaizan = now - 1984;
// // const ageSoubia = now - 1986;

// // console.log(ageFaizan, ageSoubia)
// // let x = 10 + 15 // answer will be 15
// // console.log(x)

// // x += 10 // x=x+10 current x value is 25
// // console.log(x)


// // console.log(typeof x)

// // console.log(ageFaizan > ageSoubia)


// let massMark;
// let heightMark;
// let massJohn;
// let heightJohn;




// massMark = 78;
// heightMark = 1.69;
// massJohn = 92;
// heightJohn = 1.95;

// let bmiMark = massMark / (heightMark * heightMark)

// let bmiJohn = massJohn / (heightJohn * heightMark)


// let markHigherBMI = bmiMark > bmiJohn;
// console.log(bmiMark);
// console.log(bmiJohn);

// console.log(markHigherBMI)


// const firstName = "Faizan"
// const job = "Senior Manager"
// const birthYear = 1984;
// const year = new Date().getUTCFullYear();

// const faizan = `I'm ${firstName}, a ${year - birthYear} years old ${job}`;
// console.log(faizan)


// console.log(`This is a template literal example \n\with multiple lines`)

// console.log(`we can do
// multiple lines l
// ike this also.
// it does not need that \ n way of
// moving to next line.`)




// const age = 17;
// const isOldEnough = age >= 18;

// if (isOldEnough) {
// console.log(`Sarah can start driving lesson 🚗`)
// } else {
// const yearsLeft = 18 - age;
// console.log(`Sarah is still young to drive. wait another ${yearsLeft} years ❌`)
// }

// // if (!isOldEnough) {
// // console.log(`Sarah cannot start driving yet ❌`)
// // }


function getRandomInt(max) {
return Math.floor(Math.random() * max);
}
let score = getRandomInt(1000)

console.log(score)
36 changes: 36 additions & 0 deletions 01-Fundamentals-Part-1/assignment/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!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 1</title>
<style>
body {
height: 100vh;
display: flex;
align-items: center;
background: linear-gradient(to top left, #28b487, #7dd56f);
}

h1 {
font-family: sans-serif;
font-size: 50px;
line-height: 1.3;
width: 100%;
padding: 30px;
text-align: center;
color: white;
}
</style>
<script src='assignment.js'>

</script>
</head>

<body>
<h1>JavaScript Fundamentals – Part 1</h1>
</body>

</html>
62 changes: 34 additions & 28 deletions 01-Fundamentals-Part-1/final/index.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
<!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 1</title>
<style>
body {
height: 100vh;
display: flex;
align-items: center;
background: linear-gradient(to top left, #28b487, #7dd56f);
}
h1 {
font-family: sans-serif;
font-size: 50px;
line-height: 1.3;
width: 100%;
padding: 30px;
text-align: center;
color: white;
}
</style>
</head>
<body>
<h1>JavaScript Fundamentals – Part 1</h1>

<script src="script.js"></script>
</body>
</html>
<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 1</title>
<style>
body {
height: 100vh;
display: flex;
align-items: center;
background: linear-gradient(to top left, #28b487, #7dd56f);
}

h1 {
font-family: sans-serif;
font-size: 50px;
line-height: 1.3;
width: 100%;
padding: 30px;
text-align: center;
color: white;
}
</style>
</head>

<body>
<h1>JavaScript Fundamentals – Part 1</h1>

<script src="script.js">
//over here we have called this script file when we have defined the script.js file.
</script>
</body>

</html>
25 changes: 25 additions & 0 deletions 01-Fundamentals-Part-1/final/script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
let js = "amazing";
//if (js === "amazing") alert("Javascript is FUN!")
console.log(40 + 8 + 23 - 10);
console.log("Faizan")

let firstName = "faizan aqeel"
console.log(firstName)
console.log(firstName)

console.log(firstName)
console.log(firstName)

//Uncaught SyntaxError: Invalid or unexpected token (at script.js:13:5)Understand this errorAI
//let 3years = 3;
//variable cannot start with a number

//let faian& aqeel = "JM"

//reserved keywords cannot be used as well in Javascript.
//new is a reserved word
//but it can still be used by adding a dollar $ Sign as you can see below
// new , function, name and etc...

let $new = 17;

/*
////////////////////////////////////
// Linking a JavaScript File
Expand Down
67 changes: 40 additions & 27 deletions 01-Fundamentals-Part-1/starter/index.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
<!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 1</title>
<style>
body {
height: 100vh;
display: flex;
align-items: center;
background: linear-gradient(to top left, #28b487, #7dd56f);
}
h1 {
font-family: sans-serif;
font-size: 50px;
line-height: 1.3;
width: 100%;
padding: 30px;
text-align: center;
color: white;
}
</style>
</head>
<body>
<h1>JavaScript Fundamentals – Part 1</h1>
</body>
</html>

<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 1</title>
<style>
body {
height: 100vh;
display: flex;
align-items: center;
background: linear-gradient(to top left, #28b487, #7dd56f);
}

h1 {
font-family: sans-serif;
font-size: 50px;
line-height: 1.3;
width: 100%;
padding: 30px;
text-align: center;
color: white;
}
</style>
<script>
//when script is defined in the same html file, its referred as inline script
//the only advantage of inline script is that we dont have to load another file.
//and it is also bad for separating the website content from javascript logic
//so we should normally move this code to a separate script file.
let js = "amazing";
if (js === "amazing") alert("Javascript is FUN!")
console.log(40 + 8 + 23 - 10);
</script>
</head>

<body>
<h1>JavaScript Fundamentals – Part 1</h1>
</body>

</html>