Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
right if essentially returning what you are evaluating, returning the expression should suffice.
would love to hear from others regarding this.
@preste101 array is not falsy, null is.
in your console. you will see evaluated as such.. array evaluated as true, null as false.
thus my my comment, case. execute the these expressions below seperately.
'(703) 555-5555'.match(new RegExp('^\\([0-9]{3}\\)\\s[0-9]{3}-[0-9]{4}$', "gim")) && console.log('true');
'7035555555'.match(new RegExp('^\\([0-9]{3}\\)\\s[0-9]{3}-[0-9]{4}$', "gim")) || console.log('false');
I agree. I only test positive values (or zero), as negative values do not make sense as a quantity of something, and so cannot have a "plurality". I've added a note to the description to this effect.
I'm not sure I understand what you mean here... The solution you provided works as expected, and the tests are all correct as far as I can see. If the tests fail, they should print the error message along with the expected and received values that are not matching.
Could you tell me what you think the correct answers should be for each test?, please?
thanks, jsdev... I guess I just don't understand what Test Fixtures is about at all.
what sounds better? "-1 car" or "-1 cars". I think the latter.
This comment is hidden because it contains spoiler information about the solution
this is a heads up for everyone I see this a lot... anywhere you have "? true : false" you can omit it... as it's redundant
case in point: return phoneNumber.match(new RegExp('^\([0-9]{3}\)\s[0-9]{3}-[0-9]{4}$', "gim")) // will return true or false...
This comment is hidden because it contains spoiler information about the solution