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

wala lang v001 #448

Open
wants to merge 4 commits 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
54 changes: 27 additions & 27 deletions 01-Fundamentals-Part-1/final/index.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<!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>
<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>
<script src="script.js"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions 01-Fundamentals-Part-1/starter/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// // Type Conversion and coercion
// const inputYear = "1991";
// console.log(Number(inputYear), inputYear);
// console.log(Number(inputYear) + 18);

// console.log(Number("Wilfred"));
// console.log(typeof NaN);

// console.log(String(23), 23);

// // type coercion
// console.log("I am " + 23 + " years old");

// console.log("23" - "10" - 3);
// console.log("23" + "10" + 3);

// 21. Truthy and Falsy Values

console.log(Boolean(0));
console.log(Boolean(undefined));
console.log(Boolean("Wilfred"));
console.log(Boolean({}));
console.log(Boolean(""));

const myHeading = document.querySelector("h1");
myHeading.textContent = "Hello World";
54 changes: 28 additions & 26 deletions 01-Fundamentals-Part-1/starter/index.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
<!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>
<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="app.js"></script>
</body>
</html>
45 changes: 45 additions & 0 deletions 02-Fundamentals-Part-2/starter/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
function logger() {
console.log("My name is Wilfed");
}

// calling / running/ invoking function
logger();

function fruitProcessor(apples, oranges) {
console.log(apples, oranges);
const juice = `Juice with ${apples} apples and ${oranges} oranges.`;

return juice;
}

function fruitProcessorOutput(apples, oranges) {
console.log(apples, oranges);
const juice = `Juice with ${apples} apples and ${oranges} oranges.`;

return juice;
}

fruitProcessor(5, 0); // these actual values here of the parameters are called the arguments.

const showJuices = fruitProcessorOutput(5, 0);

console.log(showJuices);

// ============ my own function ======================
function carBrands(Toyota, Ford) {
const cars = `Top notches cars are ${Toyota} & ${Ford}`;
return cars;
}

const displayCars = carBrands("Lexus", "Tesla");
console.log(displayCars);

const displayCars2nd = carBrands("Bogatti", "Honda");
console.log(displayCars2nd);

// create a generic function that will reusable
// benefit in craeting a function is reusable
// not all the time a function return a function
// example ani na use case naa sa mga component like sa styling karon mao akoang na notice
// importante kaayo masabatan nako ang detailed ani concept sa function
// DRY code = dont repeat yourself