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

Added Magical Sorting Hat #1886

Closed
wants to merge 10 commits into from
Closed

Conversation

EpicNesh26
Copy link

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.

shruti110503 and others added 10 commits June 4, 2024 14:06
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.
Copy link

netlify bot commented Jun 29, 2024

Deploy Preview for 30daysofjs ready!

Name Link
🔨 Latest commit e1c58c2
🔍 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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants