30DaysOfJavaScript
30DaysOfJavaScript copied to clipboard
Added Magical Sorting Hat
The Magical Sorting Hat project involves creating a JavaScript function to simulate a sorting hat for a wizard school. The function takes an array of student names and assigns each student to one of four houses—Gryffindor, Hufflepuff, Ravenclaw, or Slytherin—based on the length of their names.
👨💻 Changes proposed and Brief Description
Project Overview: Imagine you're developing a magical sorting hat for a wizard school, inspired by the famous Sorting Hat from the Harry Potter series. The goal is to create a JavaScript function that sorts an array of student names into one of four houses based on the length of their names. The houses and their criteria are as follows:
Gryffindor: Names shorter than 6 characters. Hufflepuff: Names with 6 to 7 characters. Ravenclaw: Names with 8 to 11 characters. Slytherin: Names with 12 or more characters. Learning Outcomes Basic JavaScript Syntax and Functions: By working on this project, you'll learn how to write and utilize JavaScript functions, a fundamental aspect of programming in JavaScript.
Conditional Statements: You'll gain experience using if-else statements to implement logic based on specific conditions. This is essential for making decisions in your code.
Array Manipulation: You'll learn how to work with arrays, including how to iterate through them using loops and how to push elements into different arrays based on conditions.
String Length Property: You'll become familiar with the length property of strings, which is crucial for many programming tasks that involve text processing.
Debugging Skills: By running and testing your code, you'll develop your debugging skills, learning how to troubleshoot and fix errors that arise.
✅ Check List (Check all the applicable boxes)
- [✅] My code doesn't break any part of the project
- [✅] This PR does not contain plagiarized content.
- [✅] My Addition/Changes works properly and matches the overall repo pattern.
- [✅] The title of my pull request is a short description of the requested changes.
Deploy Preview for 30daysofjs ready!
| Name | Link |
|---|---|
| Latest commit | e1c58c2fe1005e8c9f1b9d739690de8341027a94 |
| Latest deploy log | https://app.netlify.com/sites/30daysofjs/deploys/667f76906b59ee0008822fc8 |
| Deploy Preview | https://deploy-preview-1886--30daysofjs.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.