From e5c0164886403103c8c567ae22ad5d2367ab120c Mon Sep 17 00:00:00 2001 From: Wilfred Erdo Bancairen Date: Mon, 20 Jan 2025 11:14:23 +0800 Subject: [PATCH 1/4] wala lang v001 --- 01-Fundamentals-Part-1/final/index.html | 54 ++++++++++++------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/01-Fundamentals-Part-1/final/index.html b/01-Fundamentals-Part-1/final/index.html index 96fbc80614..f9b3434078 100755 --- a/01-Fundamentals-Part-1/final/index.html +++ b/01-Fundamentals-Part-1/final/index.html @@ -1,31 +1,31 @@ - - - - - JavaScript Fundamentals – Part 1 - - - -

JavaScript Fundamentals – Part 1

+ + + + + JavaScript Fundamentals – Part 1 + + + +

JavaScript Fundamentals – Part 1

- - + + From 44f18c14537f4a532198438fa75b84c2c59987d5 Mon Sep 17 00:00:00 2001 From: Wilfred Erdo Bancairen Date: Mon, 27 Jan 2025 09:38:08 +0800 Subject: [PATCH 2/4] 20. Type Conversion and Coercion - end --- 01-Fundamentals-Part-1/starter/app.js | 15 +++++++ 01-Fundamentals-Part-1/starter/index.html | 53 ++++++++++++----------- 2 files changed, 42 insertions(+), 26 deletions(-) create mode 100644 01-Fundamentals-Part-1/starter/app.js diff --git a/01-Fundamentals-Part-1/starter/app.js b/01-Fundamentals-Part-1/starter/app.js new file mode 100644 index 0000000000..9b93b7fa2d --- /dev/null +++ b/01-Fundamentals-Part-1/starter/app.js @@ -0,0 +1,15 @@ +// 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); diff --git a/01-Fundamentals-Part-1/starter/index.html b/01-Fundamentals-Part-1/starter/index.html index 59529c7923..58c9d15ed9 100755 --- a/01-Fundamentals-Part-1/starter/index.html +++ b/01-Fundamentals-Part-1/starter/index.html @@ -1,29 +1,30 @@ - - - - - JavaScript Fundamentals – Part 1 - - - -

JavaScript Fundamentals – Part 1

- + + + + + JavaScript Fundamentals – Part 1 + + + +

JavaScript Fundamentals – Part 1

+ + From eb65551ab6d82a96dcc760b990f0033637ed7812 Mon Sep 17 00:00:00 2001 From: Wilfred Erdo Bancairen Date: Tue, 4 Feb 2025 04:39:38 +0800 Subject: [PATCH 3/4] Feb 4, learning in JavaScript --- 01-Fundamentals-Part-1/starter/app.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/01-Fundamentals-Part-1/starter/app.js b/01-Fundamentals-Part-1/starter/app.js index 9b93b7fa2d..308e3635db 100644 --- a/01-Fundamentals-Part-1/starter/app.js +++ b/01-Fundamentals-Part-1/starter/app.js @@ -1,15 +1,15 @@ -// Type Conversion and coercion -const inputYear = "1991"; -console.log(Number(inputYear), inputYear); -console.log(Number(inputYear) + 18); +// // 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(Number("Wilfred")); +// console.log(typeof NaN); -console.log(String(23), 23); +// console.log(String(23), 23); -// type coercion -console.log("I am " + 23 + " years old"); +// // type coercion +// console.log("I am " + 23 + " years old"); -console.log("23" - "10" - 3); -console.log("23" + "10" + 3); +// console.log("23" - "10" - 3); +// console.log("23" + "10" + 3); From 0893828ce71f4c0f79ffc26a609abcb200b3c398 Mon Sep 17 00:00:00 2001 From: Wilfred Erdo Bancairen Date: Tue, 4 Feb 2025 04:40:22 +0800 Subject: [PATCH 4/4] feb 4, 2025 learning javascript function creation --- 01-Fundamentals-Part-1/starter/app.js | 11 ++++++ 01-Fundamentals-Part-1/starter/index.html | 1 + 02-Fundamentals-Part-2/starter/script.js | 45 +++++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/01-Fundamentals-Part-1/starter/app.js b/01-Fundamentals-Part-1/starter/app.js index 308e3635db..88ba73e947 100644 --- a/01-Fundamentals-Part-1/starter/app.js +++ b/01-Fundamentals-Part-1/starter/app.js @@ -13,3 +13,14 @@ // 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"; diff --git a/01-Fundamentals-Part-1/starter/index.html b/01-Fundamentals-Part-1/starter/index.html index 58c9d15ed9..1f400d26c3 100755 --- a/01-Fundamentals-Part-1/starter/index.html +++ b/01-Fundamentals-Part-1/starter/index.html @@ -25,6 +25,7 @@

JavaScript Fundamentals – Part 1

+ diff --git a/02-Fundamentals-Part-2/starter/script.js b/02-Fundamentals-Part-2/starter/script.js index e69de29bb2..1542839cea 100755 --- a/02-Fundamentals-Part-2/starter/script.js +++ b/02-Fundamentals-Part-2/starter/script.js @@ -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