You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fbfreitas edited this page Sep 20, 2024
·
1 revision
Implement the following JavaScript functions:
filterProperties(propNames,obj)
Receives a string array in propNames and an object in obj. Returns a new object with the properties from obj whose names are present in propNames. If propNames contains names that do not exist in obj, those properties are not added to the returned object.
Receives a string array in propNames and an object array in objs. Returns a new object array with objects produced by applying the filterProperties function with propNames to each object in objs.
NOTE: In this implementation, the usage of any cycle instruction (for/while) or the Array.forEach method reduces the grade in 50%.