What if i want to add a solution to a challenge solutions?

I’ve used a different approach on solving a challenge and i’d like to share it, maybe it is going to help somebody…
link to the challenge :


function whatIsInAName(collection, source) {

  // Only change code below this line

  let arr = collection.filter((obj)=> {

    let count = 0;//the counter to test

    for (let key in obj) {//to loop through an object of

                          //of the collection array 

     for (let keysrc in source) {//to loop through 

                          //the "source" object

        if (key === keysrc && obj[key] === source[keysrc]) {

          count++;//if the keys and the values are the same

                  //the counter increases by one




    if (count === Object.keys(source).length) {

      return true;//returns true, so the object on which 

      //the filter method is operating, stays in the

      //collection array



  // Only change code above this line

  return arr;


Hello there.

Thank you, for your contribution. For future contributions, please wrap your solution within :

code goes here...

Also, provide all of the necessary code to pass the challenge.

Also, when you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor ( </> ) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).