{"id":18572755,"url":"https://github.com/truecodersio/javascript_selections_loops","last_synced_at":"2026-01-27T23:47:36.446Z","repository":{"id":38841389,"uuid":"327426542","full_name":"truecodersio/JavaScript_Selections_Loops","owner":"truecodersio","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-11T19:59:01.000Z","size":6,"stargazers_count":1,"open_issues_count":3,"forks_count":567,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T14:31:13.314Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/truecodersio.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}},"created_at":"2021-01-06T20:51:12.000Z","updated_at":"2024-08-29T02:52:44.000Z","dependencies_parsed_at":"2023-02-09T05:47:42.756Z","dependency_job_id":null,"html_url":"https://github.com/truecodersio/JavaScript_Selections_Loops","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"benrbryant/Exercise_Template","purl":"pkg:github/truecodersio/JavaScript_Selections_Loops","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2FJavaScript_Selections_Loops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2FJavaScript_Selections_Loops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2FJavaScript_Selections_Loops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2FJavaScript_Selections_Loops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/truecodersio","download_url":"https://codeload.github.com/truecodersio/JavaScript_Selections_Loops/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2FJavaScript_Selections_Loops/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28827902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2024-11-06T23:07:07.580Z","updated_at":"2026-01-27T23:47:36.425Z","avatar_url":"https://github.com/truecodersio.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaScript Loops Exercise\n\n## Getting Started\n\nExercise Repo: [JavaScript Loops](https://github.com/Bryantellius/JavaScript_Selections_Loops)\n\n1. Open your command line and navigate to your repos directory (if you do not have a repos folder, then you can use mkdir repos to create one)\n2. Use this template repository to start a new project in your repos folder: `git clone \u003crepo_name\u003e`\n3. `cd repo_name` to navigate into your new repo directory\n4. Start Visual Studio Code and select 'Open Folder'. Then select `repo_name` to open the folder in the editor (or just type `code .` in your terminal inside the repo directory)\n5. Follow the instructions on the README.md file to complete exercises\n6. Open the `app.js` file to get started\n\n## Exercise 1: Ignore Even\n\nIn this exercise, you will be counting from 1 - 100. For each odd number, you will print the number to the console. If the number is even, do nothing.\n\n1. Create a `for` loop that evaluates numbers from 1 to 100.\n2. Inside the loop body, write an `if/else` selection statement that checks whether a number is odd\n3. If the number is odd, then print the number to the console, otherwise do nothing and continue to the next number\n\n## Exercise 2: FIZZBUZZ\n\nFIZZBUZZ is a very common coding interview problem. Below are the instructions to solving the problem:\n\n1. Create a `for` loop that evaluates numbers from 1 to 100 like the problem above.\n2. Write a `if/else` selection statement inside the body of the the loop that checks the following:\n   - If the number is divisible by 3, then console.log `'FIZZ'`\n   - If the number is divisible by 5, then console.log `'BUZZ'`\n   - If the number is divisible by both 3 and 5, then console.log `'FIZZBUZZ'`\n\nEx: `15` would print `'FIZZBUZZ'`, `33` would print `'FIZZ'`, and `35` would print `'BUZZ'`\n\n## Exercise 3: Repeat with While and Do/While\n\nFor exercise 3, repeat both exercise 1 and 2 as `while` and `do/while` loop solutions.\n\n## Exercise 4: Find Value\n\nIn this exercise, you will count from iterate from 1 to n. If you iterate over a given value, then break out the loop and print \"Found value!\". If you do not find the value in the given range, print \"Did not find value\".\n\n1. Start with the following code:\n\n```js\nlet value = Math.round((Math.random() * 500)); // creates a random number between 0 and 500\nlet n = Math.round(Math.random() * (500 - 100) + 100); // creates a random number between 100 and 500\n```\n\n2. Create a `for` loop that iterates from 0 to n\n3. If your current iteration is equal to `value`, then print \"Found value!\", and `break` out of the loop\n4. If you do not ever find the value and break out of the loop, then after the loop is finished, print \"Did not find value\"\n\n## Exercise 5: Customized FIZZBUZZ\n\nWe already completed the FIZZBUZZ challenge. Now repeat the logic for the FIZZBUZZ challege with values provided in variables.\n\n1. Start with the following code:\n\n```js\nlet fizzDivisor = Math.round(Math.random() * (10 - 1) + 1);\nlet buzzDivisor = Math.round(Math.random() * (10 - 1) + 1);\nlet n = Math.round(Math.random() * (1000 - 1) + 1);\nlet start = Math.round(Math.random() * (10 - 1) + 1);\n```\n\n2. Re-implement exercise 2, but use `start` as the initial value for `i`, `n` as the range limit in `i \u003c= n`, and `fizzDivisor` and `buzzDivisor` as the dependent values for determining \"FIZZ\" and \"BUZZ\" print messages.\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruecodersio%2Fjavascript_selections_loops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftruecodersio%2Fjavascript_selections_loops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruecodersio%2Fjavascript_selections_loops/lists"}