Brief example of how to use the switch statement in javascript
Brief example of how to use the switch statement in javascript
Join chat rooms and explore programming content on Chat-to.dev.
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.
You're viewing a single thread.
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)
1 0 Replythank 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
0 0 ReplyThat 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"
1 0 Replywe have the policies here https://chat-to.dev/privacy, you must have entered by cell phone
1 0 ReplyIndeed, I've visited via Mobile. So with tongue in cheek: "are mobile users not entitled to those informations?" :D
2 0 ReplyActually, there is, since it's a new site, we're working on all this, and we apologize in advance.
1 0 Reply