Ad
  • Custom User Avatar

    It is right, some one helped me by printing trough JSON.stringify but the real test is [ NaN, 1, NaN, 1 ] wich should return NaN. NaN is printed as null by this utility so I added the other printing If I see that JSON.stringify keep producing troubles will erase it Thank you for your interest.

  • Default User Avatar

    What objs.map is doing is for each object in the array it is handing it off to the function enclosed within the () that follow map.

    That function is taking the objects map gives it (and map is giving it each object) therefore it will return obj[name] back to the map function and map creates a new array with that obj[name] pushed to it.

    It is basically the shorthand for creating a new array and a for-loop that pushes to it.
    Read more here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map