{"id":26964205,"url":"https://github.com/jasheloper/conditionals-test-3","last_synced_at":"2025-07-19T03:37:38.267Z","repository":{"id":201107846,"uuid":"706455299","full_name":"jasheloper/conditionals-test-3","owner":"jasheloper","description":"Test skills with JavaScript conditionals.","archived":false,"fork":false,"pushed_at":"2023-10-24T01:16:23.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T06:35:55.322Z","etag":null,"topics":["conditionals","if-else","javascript"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/jasheloper.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":"2023-10-18T01:46:46.000Z","updated_at":"2024-03-07T08:23:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"546f8dd7-d7c8-4422-aa46-95fbf8631da9","html_url":"https://github.com/jasheloper/conditionals-test-3","commit_stats":null,"previous_names":["jasheloper/conditionals-test-3"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jasheloper/conditionals-test-3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasheloper%2Fconditionals-test-3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasheloper%2Fconditionals-test-3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasheloper%2Fconditionals-test-3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasheloper%2Fconditionals-test-3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasheloper","download_url":"https://codeload.github.com/jasheloper/conditionals-test-3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasheloper%2Fconditionals-test-3/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265883713,"owners_count":23843800,"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":["conditionals","if-else","javascript"],"created_at":"2025-04-03T06:30:11.878Z","updated_at":"2025-07-19T03:37:38.243Z","avatar_url":"https://github.com/jasheloper.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Exercise Link\n\nhttps://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Test_your_skills:_Conditionals#conditionals_3\n\n\n## Instructions\n\nFor the final task you are given four variables:\n\n- `machineActive` — contains an indicator of whether the login machine is switched on or not (`true`/`false`).\n\n- `pwd` — Contains the user's login password.\n\n- `machineResult` — begins uninitialized, but is later used to store a response that will be printed to the output panel, letting the user know whether the machine is switched on.\n\n- `pwdResult` — begins uninitialized, but is later used to store a response that will be printed to the output panel, letting the user know whether their login attempt was successful.\n\n\u003cbr\u003e\n\nWe'd like you to create an `if...else` structure that checks whether the machine is switched on and puts a message into the `machineResult` variable telling the user whether it is on or off.\n\n\u003cbr\u003e\n\nIf the machine is on, we also want a second conditional to run that checks whether the `pwd` is equal to `cheese`.\n\n- If so, it should assign a string to `pwdResult` telling the user they logged in successfully. \n- If not, it should assign a different string to `pwdResult` telling the user their login attempt was not successful. We'd like you to do this in a single line, using something that isn't an `if...else` structure.\n\n\u003cbr\u003e\n\n## My Solution\n\n```\n    let machineActive = true;\n    let pwd = \"cheese\";\n\n    let machineResult;\n    let pwdResult;\n\n    // Add your code here\n    \n        if (machineActive) {\n            machineResult = \"Machine Status = ON\";\n            pwdResult = pwd === \"cheese\" ? \"Login attempt was successful!\" : \"Login attempt unsuccessful.\"\n        } else {\n            machineResult = \"Machine Status = OFF\";\n        }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasheloper%2Fconditionals-test-3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasheloper%2Fconditionals-test-3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasheloper%2Fconditionals-test-3/lists"}