The switch statement is an alternative to if/else conditional construct (commonly called a “case statement”) and may make the program more readable when handling multiple options.

2 points

The code shown contains an error. Instead of multiply by seven, you probably mean divide by seven.

Faulty code example: Math.floor((Math.random()* 7)+1)

permalink
report
reply
1 point

thank you for the comment. but it would be very gratifying if this comment were left on the site. it would help our work to grow

permalink
report
parent
reply
2 points
*

That would require another account but I’m reluctant to create one since:

  • no privacy policy
  • no legal info who runs the site
  • given the first two points the “risk”-reward does not balance

Risk is in quotes since it’s more of a “why bother?” than “oh no my info got stolen”

permalink
report
parent
reply
1 point

we have the policies here https://chat-to.dev/privacy, you must have entered by cell phone

permalink
report
parent
reply

Learn Programming

!learn_programming@programming.dev

Create post

Posting Etiquette

  1. Ask the main part of your question in the title. This should be concise but informative.

  2. Provide everything up front. Don’t make people fish for more details in the comments. Provide background information and examples.

  3. Be present for follow up questions. Don’t ask for help and run away. Stick around to answer questions and provide more details.

  4. Ask about the problem you’re trying to solve. Don’t focus too much on debugging your exact solution, as you may be going down the wrong path. Include as much information as you can about what you ultimately are trying to achieve. See more on this here: https://xyproblem.info/

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

Community stats

  • 2

    Monthly active users

  • 102

    Posts

  • 481

    Comments