Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Count strings in objects #7

Open
hellocan opened this issue Apr 11, 2016 · 0 comments
Open

Count strings in objects #7

hellocan opened this issue Apr 11, 2016 · 0 comments

Comments

@hellocan
Copy link

Create a function strCount (takes an object as argument) that will count all string values inside an object. For example:
strCount({
first: "1",
second: "2",
third: false,
fourth: ["anytime",2,3,4],
fifth: null
})
//returns 3

Your Test Cases:
Test.assertEquals(strCount({
first: "1",
second: "2",
third: false,
fourth: ["anytime",2,3,4],
fifth: null,
sixth: undefined,
seventh:{}
}),3,"Did not count the correct number of strings. Check counting inside nested objects.");

where By
http://www.codewars.com/kata/565b3542af398bfb50000003/train/javascript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant