Skip to content

Conversation

@haragam22
Copy link
Contributor

Ah! Perfect — now I understand. Issue #76 is asking you to implement the Prime Check algorithm in JavaScript under the SyntaxBasics (Syn) folder.

We can prepare a ready-to-paste Pull Request (PR) message for this feature, just like your previous PRs.


🚀 Submission Checklist

Thank you for contributing! Please check the boxes below to ensure a fast review.

  • My code is placed in the correct Languages/JavaScript/SyntaxBasics/prime_check.js
  • My code is functional and includes necessary comments.
  • This PR addresses an existing issue.

🔗 Linked Issue

Closes #76


🧩 Description

Added a JavaScript implementation of Prime Check under the SyntaxBasics section.
This program checks whether a number is prime using a simple loop-based approach and demonstrates JavaScript fundamentals like loops, conditionals, and input/output handling.


🧠 Features

  • ✅ Beginner-friendly JavaScript code
  • 🔁 Checks for primes using a straightforward iterative method
  • 🧩 Handles numbers less than 2 and larger inputs
  • 💬 Displays results clearly in the console
  • 🧠 Strengthens the JavaScript SyntaxBasics folder with a fundamental math example

🧪 Example Run

Input (via prompt() or hardcoded in code):

17

Output:

17 is prime

🖥️ Verification

Tested locally using Node.js:

node Languages/JavaScript/SyntaxBasics/prime_check.js

✅ Works for various test cases (e.g., 1, 2, 3, 16, 17, 23)
✅ Handles invalid or small inputs gracefully


🏷️ Commit Message

feat(JavaScript): Add Prime Check implementation under SyntaxBasics

@haragam22
Copy link
Contributor Author

kindly review this pr for hacktoberfest 2025 at the erliest.

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.

feat(Javascript): [Basics/Primality Test]

1 participant