{"id":25460780,"url":"https://github.com/hasibcoderlab/javascript-conditional-and-ternary-operators","last_synced_at":"2025-11-03T09:30:32.946Z","repository":{"id":277396220,"uuid":"932297833","full_name":"HasibCoderLab/JavaScript-conditional-and-ternary-operators","owner":"HasibCoderLab","description":"A collection of JavaScript examples demonstrating if-else statements and conditional (ternary) operators. Covers multiple real-world scenarios with ES6 features.","archived":false,"fork":false,"pushed_at":"2025-02-13T17:57:58.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T18:36:50.858Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HasibCoderLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-13T17:29:16.000Z","updated_at":"2025-02-13T17:58:02.000Z","dependencies_parsed_at":"2025-02-13T18:47:38.132Z","dependency_job_id":null,"html_url":"https://github.com/HasibCoderLab/JavaScript-conditional-and-ternary-operators","commit_stats":null,"previous_names":["hasibcoderlab/javascript-conditional-and-ternary-operators"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasibCoderLab%2FJavaScript-conditional-and-ternary-operators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasibCoderLab%2FJavaScript-conditional-and-ternary-operators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasibCoderLab%2FJavaScript-conditional-and-ternary-operators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasibCoderLab%2FJavaScript-conditional-and-ternary-operators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HasibCoderLab","download_url":"https://codeload.github.com/HasibCoderLab/JavaScript-conditional-and-ternary-operators/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239412476,"owners_count":19634016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-18T05:04:13.637Z","updated_at":"2025-11-03T09:30:32.881Z","avatar_url":"https://github.com/HasibCoderLab.png","language":"JavaScript","readme":"# JavaScript Conditional and Ternary Operators\n\nThis repository contains various JavaScript examples showcasing `if-else` statements and the conditional (ternary) operator. It demonstrates multiple real-world use cases, including number checks, leap year determination, voting eligibility, and more.\n\n## 📌 Features\n- **If-Else Statements**: Covers different conditions with multiple cases.\n- **Ternary Operator**: Simplified conditional expressions.\n- **ES6 Features**: Arrow functions, template literals, and more.\n- **Practical Examples**: Number checks, leap years, voting eligibility, and more.\n\n## 🚀 Examples\n### If-Else Statements\n```js\nfunction checkNumber(num) {\n    if (num \u003e 0) {\n        return \"Positive\";\n    } else if (num \u003c 0) {\n        return \"Negative\";\n    } else {\n        return \"Zero\";\n    }\n}\nconsole.log(checkNumber(10));  // Output: \"Positive\"\n\nTernary Operator\n\nconst checkNumber = (num) =\u003e num \u003e 0 ? \"Positive\" : num \u003c 0 ? \"Negative\" : \"Zero\";\nconsole.log(checkNumber(-7));  // Output: \"Negative\"\n````````````\n\n\n\n📂 File Structure\n`````\n/project-root\n│── script.js      # JavaScript logic\n│── index.html     # HTML file to load the script\n│── README.md      # Project documentation\n``````````````\n\n\n🛠️ How to Use\n-**1.Clone this repository:\n```\ngit clone https://github.com/HasibCoderLab/JavaScript-conditional-and-ternary-operators.git\n````\n\n-**2.Open index.html in a browser.\n-**3.Check the console for outputs.\n\n\n📜 License\nThis project is open-source and available under the MIT License.\n\nHappy Coding! 🚀\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasibcoderlab%2Fjavascript-conditional-and-ternary-operators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasibcoderlab%2Fjavascript-conditional-and-ternary-operators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasibcoderlab%2Fjavascript-conditional-and-ternary-operators/lists"}