Invert values

PHOTO EMBED

Tue Oct 04 2022 10:12:24 GMT+0000 (Coordinated Universal Time)

Saved by @j_jivan #javascript

/*Given a set of numbers, return the additive inverse of each. Each positive becomes negatives, and the negatives become positives.*/

function invert(array) {
   return array.map(each=>{
     return each * -1;
   })
}
content_copyCOPY

https://www.codewars.com/kata/5899dc03bc95b1bf1b0000ad/solutions/javascript