8 kyu
Training JS #8: Conditional statement--switch
17,274 of 17,286myjinxin2015
Loading description...
Fundamentals
Tutorials
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
there is bug in js language
This comment has been hidden.
This comment has been hidden.
а зачем такая паста кода если можно через свитч было сделать?
"Today it's Wednesday" = 'Today it is Wednesday".
Now let's refactor these examples: "Today is Wednesday".
(Seeing these examples written this way, just killed me. Just say, "Today is Wednesday", "Today is Tuesday", "Today is Friday.")
You have passed all of the tests! but cant attempt this test. "Expected: '30', instead got: 'undefined' Log Test for: month=5 "
Please use the
issue
tag when there's a verified problem with the kata itself. If you're having trouble with the code, please ask aquestion
instead. In this case the problem is definitely with your code. Hint: what is the variablex
?I don't know why but, Im getting this if I tried to submit: " Unhandled rejection TestError: Expected: '31', instead got: ''31'' "
This comment has been hidden.
saudiGuy: if you mark your comment with a spoiler flag, OP will be able to do it only if he has solved the kata.
This comment has been hidden.
Well I messed by myself I just found the solution... on google I don't know why I couldn't see what was in front of me I was too much focus on the example switch.
This comment has been hidden.
Your function should return the number of days in any given month, read the description again:
Most
font color
tags aren't working in random tests.This is the same in almost all of myjinxin's katas. Fixed in CoffeeScript, JS is locked tho. A
before it fixes it somehow.=== vs == fixed ;)
Coffeescript version kumited! Please accept :smile:
Approved. Cheers ;-)
Great beginner Kata but could have included test cases to make sure that the user is using a
switch
statement in their code (see my solution). Otherwise, beginners may "cheat" by using the ternary operator or if/else statements and they would learn nothing new.ok, i will add a simple check function, but maybe later
added ;-)
you may want to have a better way to test if they are using a switch statement, but don't go crazy with the anti-cheats...
only a few code