Skip to content

Count strings in objects #7

Description

@hellocan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions