Hey there! This is my solution for Module 4 of the Coursera HTML, CSS, and Javascript for Web Developers course. It’s a cool little JavaScript program that says "Hello" or "Good Bye" to names in the console, depending on whether they start with a 'J'. Wanna see it in action? Let’s chat about it!
👉 Check it out here: https://ahsankhizar5.github.io/webdev-module4/
- It loops through a list of names like "Yaakov", "John", "Jen", etc.
- If a name starts with 'J' or 'j', it’s like, "Good Bye John!" in the console.
- Otherwise, it’s all, "Hello Yaakov!"
- Uses separate files for the "Hello" and "Good Bye" logic, all wrapped in IIFEs to keep things clean.
- Super simple HTML to load the scripts, no fancy styling needed.
Wanna try it yourself? Here’s the deal:
-
Grab the code:
git clone https://github.com/ahsankhizar5/coursera-webdev.git
-
Jump into the folder:
cd coursera-webdev/module4-solution
-
Fire up a local server with Browser Sync (it’s the vibe):
browser-sync start --server --files "*.html, *.js"
-
Open Chrome, hit
http://localhost:3000
, and pop open the Console (Ctrl + Shift + J
). You’ll see:Hello Yaakov Good Bye John Good Bye Jen ...
Just a few files:
index.html
: The basic page that loads the JavaScript.script.js
: Where the name-looping magic happens.SpeakHello.js
: Says "Hello" to non-J names.SpeakGoodBye.js
: Says "Good Bye" to J names.
- HTML5: Just enough to get the scripts running.
- JavaScript: The star of the show, doing all the logic.
- Browser Sync: Makes local testing smooth.
- Chrome Console: Where the output shines.
- Fork my repo on GitHub.
- Make a new branch:
git checkout -b your-cool-idea
- Add your changes and commit:
git add . git commit -m "Added something awesome"
- Push it and send me a pull request:
git push origin your-cool-idea
It’s under the MIT License, so feel free to use, tweak, or share it.
If you think this is neat or it helped you, hit that ⭐ on my GitHub repo. It’d mean a lot!
💬 “Keep it simple, keep it fun!” — Me, probably