codingforeveryone/js

New member #6 - Count strings inside an object

Closed this issue · 2 comments

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

I'd like to have a go at this - first time so very unclear about the process.

@philb56 has provided a working solution, which is now in the repo. Closing issue.