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

using every and some #177

Open
hmntptwl opened this issue Apr 30, 2017 · 0 comments
Open

using every and some #177

hmntptwl opened this issue Apr 30, 2017 · 0 comments

Comments

@hmntptwl
Copy link

hmntptwl commented Apr 30, 2017

I did it this way

function checkUsersValid(goodUsers) {
      return function allUsersValid(submittedUsers) {
var a=goodUsers.map(function(v){
    return v.id;
})
var b=submittedUsers.map(function(x){
    return x.id;
})
return b.every(function(z){
  return a.indexOf(z) > -1;
})
   
      };
    }

My solution to Basic :Call was like this

   function duckCount(...arg) {
       var c = 0 ;
      [...arg].forEach(function(v,i){
    if(Object.prototype.hasOwnProperty.call(arg[i],'quack'))  
           c++;
       })
       
     return c;
    }
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