Alpha ET
3.23K subscribers
12 photos
14 links
Download Telegram
3. What does typeof null return?
Anonymous Quiz
33%
"null"
8%
"object"
44%
"undefined"
14%
"number"
4. What is the output of "10" - 3?
Anonymous Quiz
36%
"7"
40%
103
18%
7
7%
NaN
5. Which operator checks value and type?
Anonymous Quiz
25%
==
25%
!=
27%
=
23%
===
For those who were confused this is all JavaScript.

Remember: when you use the + operator with a string, JS does concatenation, not addition. Example from the quiz: 5 + "3" becomes "53". But with the - operator, JS converts strings to numbers, so "10" - 3 becomes 7. Also keep in mind truthy and falsy values: 0, "", null, undefined, false, and NaN are falsy, while things like "0" or [] are truthy.

@alphaETHub
👍2
Today’s Mini Challenge (HTML + CSS + JS)

Build a small page where a button toggles the background color of the header or any element you like.
Just a simple color switch using JavaScript.

Please try it. the more you challenge yourself, the faster you’ll reach your frontend + backend goals.

@alphaETHub
Practicing every day is super important without consistency, it gets harder to reach the level you imagine or dream about.

I know I should help you more deeply, but since I don’t have enough time, the best I can do is guide you, suggest resources, and push you in the right direction.

For today, I recommend this 12-hour full course. You don’t need to finish it in one day.
Even 30 minutes a day + practice will make a huge difference.
In one month, you’ll see real progress.

👉 https://youtu.be/lfmg-EJ8gm4?si=rxEaWYb7UAZuVz5A



@alphaETHub
3
JavaScript Challenge - Find the Longest Word!


Write a JavaScript program that finds the longest word in a given sentence.

Example input:

"The quick brown fox jumps over the lazy dog"


Expected output:

"jumps" (or "quick"/"brown", if same length —your choice)

💡 Hints:

- Split the sentence into words (split(' '))

- Loop through the array and compare lengths

- Keep track of the longest word so far

- Return or console.log it



share your code in the comments when you’re done.


@alphaETHub
This site is honestly a gold mine
It has super short and clear cheat sheets for HTML, CSS, and JavaScript ,perfect for quick revision or learning fast.

Check it out 👇
https://htmlcheatsheet.com/js/



@alphaETHub
4
JavaScript DOM

The DOM (Document Object Model) lets you access & control HTML using JavaScript.
Here are the most useful things you’ll use daily:

🔹 Select Elements

document.getElementById("id")
document.querySelector(".class")
document.querySelectorAll("p")



🔹 Change Text / HTML

element.textContent = "Hello"
element.innerHTML = "<b>Hi</b>"



🔹 Change Styles

element.style.color = "blue"
element.style.background = "black"



🔹 Create & Add Elements

const div = document.createElement("div")
div.textContent = "New Box"
document.body.appendChild(div)



🔹 Events

button.addEventListener("click", () => {
alert("Clicked!")
})

@alphaETHub
1
Today’s Exercise : Build an Image Slider (DOM Project)

Your task for today is simple but fun:

👉 Create an Image Slider using JavaScript DOM
(slide left ➡️ right ⬅️ by clicking buttons)

Use:

document.querySelector()


.src to change images

addEventListener() for buttons

No need to make it perfect just make it work.

If you want, send your work in the group, or if you don’t feel confident yet, try it by yourself first.
The important thing is learning by doing.

@alphaETHub
👍1
Alpha ET pinned «Today’s Exercise : Build an Image Slider (DOM Project) Your task for today is simple but fun: 👉 Create an Image Slider using JavaScript DOM (slide left ➡️ right ⬅️ by clicking buttons) Use: document.querySelector() .src to change images addEventListener()…»
Today’s Exercise: Build a To-Do List App (DOM Practice)

If you completed yesterday’s image slider, great job!
Today let’s build something useful:

👉 A Simple To-Do List App using JavaScript DOM

Requirements:

- Add new tasks

- Mark tasks as done

- Delete tasks

Use querySelector(), createElement(), appendChild(), addEventListener()

It doesn’t need to look perfect , just make it work.

Send your work in the group( @alphadiscuzz ) if you want!

@alphaETHub
👍31🤬1
Alpha ET pinned «Today’s Exercise: Build a To-Do List App (DOM Practice) If you completed yesterday’s image slider, great job! Today let’s build something useful: 👉 A Simple To-Do List App using JavaScript DOM Requirements: - Add new tasks - Mark tasks as done - Delete…»
JS Tip: Name your variables clearly

Bad variable names make your code confusing.
Good names make you learn faster.

Bad

let x = 5;
let y = "John";



Good

let userAge = 5;
let userName = "John";




This is one of the easiest ways to improve your JavaScript from day one.

@alphaETHub
3👍1
JS Challenge

In JavaScript, this happens a lot in real projects:

const user = {
name: "Sam",
address: { city: "Addis", code: 1000 }
};



Challenge:
Make a safe variable called city that doesn’t break even if address is missing.

Hint: use ?.

Try it. Comment your answer 👇
@alphaETHHub
👍41
Did you know? JavaScript was created in 1995 by Brendan Eich in just 10 days! Originally called Mocha, then LiveScript, it became the language that powers almost every website today.

@alphaETHub
👍5
Did you know you can store data permanently in the browser even after refreshing or closing the page?

It’s called localStorage super useful for saving theme, username, settings, etc.

Example:

// Save data
localStorage.setItem("theme", "dark");

// Get data
console.log(localStorage.getItem("theme"));

// Remove data
localStorage.removeItem("theme");



This is how websites remember your preferences without asking again.

@alphaETHub
👍1
What will this print?

let x = 0;
console.log(x++);
console.log(++x);



React with your answer:

👍 0 then 2
🔥 1 then 2
❤️ 0 then 1
😍 1 then 1

@alphaETHub
2👍1
What will the following code print? and why?

let a = 5; // 0101 in binary
let b = 3; // 0011 in binary
console.log(a & b);



A) 1
B) 2
C) 3
D) 5


@alphaETHub
👏1
Do you agree?
👍54